Total removal of z-index from .modal class #3282
Replies: 1 comment 3 replies
-
Is this
With With the checkbox method, z-index is needed. without z-index everything that comes after the modal will be on top of it so it will force people to put the modal at the end of the document manually (or using those portals you mentioned) and it's not something everyone can do (because of isolation of code in components or limitations of CMS or because difficulty to keep track of placement of modal element or difficulty of data binding between components in different frameworks) |
Beta Was this translation helpful? Give feedback.
-
Wouldn't it be better to allow the users themselves to decide the z-index of their modal? 👀
In most cases there is no need for z-index at all.
In my case, I have a problem, and the solution is to again add more z-index or remove z-index from
.modal.
I have a modal, and inside the modal, I have a dropdown. Both modal and dropdown a
Teleported
to document.body, but because.modal
has az-index: 999
and is rendered before dropdown, it gets in front. In the end, the dropdown inside the modal is shown behind.My solution was to reset z-index of .modal
This becomes even more problematic when you have fullscreen elements, and you need to portal them inside the fullscreen element.
Example:
Beta Was this translation helpful? Give feedback.
All reactions