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

Mouse does not lineup on palette after scrolling in scrollable container #127

Closed mikerowe81 closed 7 months ago

mikerowe81 commented 9 months ago

When the color picker is placed in a scrollable container and the container is scrolled after the color picker is opened, the mouse no longer lines up on the palette and is unusable.

https://jsfiddle.net/p0q7Lfzb/8/

mikerowe81 commented 9 months ago

Just saw this previously reported in #18 Let me know if I can help troubleshoot.

mdbassit commented 9 months ago

The parent option should point to the scrollable container itself, not to one of its children. I updated the jsfiddle to reflect that: https://jsfiddle.net/Lvfj4w01/

Maybe I need to update the documentation to make that a bit clearer.

leonardfischer commented 8 months ago

@mdbassit that solution worked for me, thanks :)