tech-systems / panes

🎉📱 Create dynamic modals, cards, panes for your applications in few steps. One instance – Thousands solutions. Any framework and free.
https://panejs.com
MIT License
681 stars 40 forks source link

[BUG] modal appears and overlaps screen if parentElement is gone #224

Open woutersteven opened 12 months ago

woutersteven commented 12 months ago

Describe the bug Perhaps not really a bug, but would suggest a console log for troubleshooting.

If you have an Ionic Tabs app, and append the pane to a custom element inside the tabs at the bottom, for example

<div class="cupertino-append" style="z-index: 1000 !important;"></div>

Then navigating to another component (that's not part of the tabs) and then navigating back using the back button of your browser, will show the modal open and unable to be dismissed, because the parentElement is gone. But the modal remains overlapping the rest of the page.

I realize this is an edge case and doesn't affect people that append to body or ion-content. In my case I also attached it to an element that won't disappear, regardless of the tab routing. But it would be helpful if it could somehow be caught in the console... not sure if thats possible.

roman-rr commented 11 months ago

Related to #233, you might pass it to some global vars, singleton, or window object. But good to make panes accessible from window object from pane core as well.