Bricks Version: 1.4 Browser: Chrome 102 OS: Windows
Hello,
I have a custom palette with some colors in it, and in list view, the button “copy” seems not to work / not copying (because when I paste, it pastes the thing I’ve copied before copying the color in the palette)
sorry for the delay, I’ve been very busy those days.
I think I know where that problem come from, it’s probably an http or https url issue.
I put the website where I had that problem online, with an https domain, and now it works !
I’m working on a new preprod website, with a http domain and the problem appears again.
I hope those informations can help, if not I can provide a screencast ( I didn’t do that now because I’m 99% sure that’s the reason it is not working).
I can confirm that copying colors only works with https and have added it to our bug tracker. Let’s see what we can do. However, it is of course recommended to use https in general
You are spot on. It’s not working because of the non-HTTPS connection.
Bricks uses the Clipboard API (Clipboard API - Web APIs | MDN) to copy the color palette color to the clipboard. Which only works in “secure contexts” (i.e. HTTPS).
Now we could add some “execCommand” logic to get around this. But it is no longer recommended to use this feature anymore, so we better don’t start using it now: Document.execCommand() - Web APIs | MDN
I’ll add an alert message to the builder in the next update, though. So non-HTTPS users know why copying the color doesn’t work. As right now, it looks like a bug, I agree.