mdbassit / Coloris

A lightweight and elegant JavaScript color picker. Written in vanilla ES6, no dependencies. Accessible.
https://coloris.js.org/examples.html
MIT License
443 stars 58 forks source link

Not showing in absolute positioned div #147

Closed jrtp closed 3 months ago

jrtp commented 3 months ago

Hi, lovely lib! Found one issue that for some reason a text input with data-coloris within an absolute positioned div does not show the picker when clicked. Also I was looking for a simple way to "cancel" so it goes back to the original color - is this possible somehow?

mdbassit commented 3 months ago

Hi, lovely lib! Found one issue that for some reason a text input with data-coloris within an absolute positioned div does not show the picker when clicked.

It's hard for me to tell what the problem is without looking at your code. Did you maybe set the parent option to this div as well? If so, does the div have enough room to display the picker?

Also I was looking for a simple way to "cancel" so it goes back to the original color - is this possible somehow?

Pressing the ESC key will revert the color to its original value.

jrtp commented 3 months ago

Sorry, user error - not showing was somehow related to flex box, works like a charm now! Regarding ESC that would be the only thing I could wish for, that this option was somehow also available in UI.