sefianecho / alwan

A simple, lightweight, customizable, touch friendly color picker, written in vanilla javascript with zero dependencies.

Home Page:https://sefianecho.github.io/alwan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When there is a dialog element, the color picker box displays behind it

tranthanhhoang060391 opened this issue · comments

Hi,

Thank you for your great work!

Recently, I tried to set up a library in a dialog element (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog), whenever I click a button color, the color picker shows up behind the dialog

Screenshot 2024-04-16 at 21 32 37 Screenshot 2024-04-16 at 21 32 48

I believe the cause is the Top Layer (https://developer.mozilla.org/en-US/docs/Glossary/Top_layer)

I tried to move the <div class="alwan" ... ></div> inside the dialog, it does help to display the color picker panel above the dialog element but the position of the picker panel is incorrect ( the transform: translate CSS)

Screenshot 2024-04-16 at 21 48 20

Thank you so much for your supporting

Hi,
I understand the problem, it's a little bit complicated but I will try to fix it as soon as possible.

Any news regarding this? Would you accept PR:s?

PS: @sefianecho do you take sponsors or any other means to support your great work with this? We use it a lot on our Saas platform and it would be great to support your project somehow.

Sorry for taking so long.
The problem should be fixed now, just set the parent option to an element inside the dialog element.

As for the support I'll try to setup a sponsor page.