diecodev / qwik-sonner

An opinionated toast component for qwik.
https://qwik-sonner.deno.dev/
34 stars 3 forks source link

Use the popover api #11

Open Wykks opened 3 months ago

Wykks commented 3 months ago

Hello,

I know this is a tough one, so you may just ignore this issue if you don't run into this :sweat_smile:

When using the native browser api to show a Modal, the toast show behind the modal because of the special layer created by the native modal api. To workaround this issue, you could use the native popover api when available (with https://qwikui.com/docs/headless/popover/ of course :slightly_smiling_face: ).

Just putting this here, I'm very sorry to not have the time to help you there... I'm very busy theses days

diecodev commented 3 months ago

Hi!

I would like to use the popover api too, but that is not possible with this code. In fact, in order to implement the Popover API I would have to rewrite the whole library, but don't worry, I'm trying to find some way to move the library code out of the main DOM tree.

diecodev commented 3 months ago

EXPLANATION

The reason why I can't use the Popover API is because it needs a trigger, which must be a button. So the toast() function could not be used as it is being used. Therefore, it is necessary to look for a way to take the code of the library out of the main DOM tree, this way, only for hierarchy this will be shown above any element that is rendered inside the body.