Remove backdrop from Modal component to enable click on background elements? #2449
-
Hello! I'm trying to create a banner component using the Modal. Is there a way to remove the backdrop? This is my banner code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @J4v4Scr1pt , not sure if its the correct way to do it but the workaround is related to the z-index, Model opens in z-index 50 (tv prop If this helps, please mark this as answered, will appreciate, thanks! |
Beta Was this translation helpful? Give feedback.
-
I just wanted to add some info. We started to use this component with -z-[1] but because of this it showed behind all content. My inital testing was in StoryBook and for some reason it works there... The modal is built with a wrapper that covers the page and put modalBody to its desierd place. We will instead build our own banner using FramerMotion and hope that NextUI releases a banner component some time in the future :) Keep up the awesome work you are doing! |
Beta Was this translation helpful? Give feedback.
Hi @J4v4Scr1pt , not sure if its the correct way to do it but the workaround is related to the z-index, Model opens in z-index 50 (tv prop
z-50
), and background layer of Model covers the whole page with same z-index making other background components unclickable/un-interactable, whenever you try to interact with other background components you won't be able to because there is another layer sitting on top of it with z-50 covering whole page, so you will be clicking on that layer instead of background components, making it un-interactable.If this helps, please mark this as answered, will appreciate, thanks!