Fix z-index issue in the menu of MODX 3.x. #16778
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Add a z-index: 0 to #modx-content and remove some not needed z-index in the navbar.
Why is it needed?
Fix the z-index issue in the menu of MODX 3.x.
The reason for this issue can be found in https://coder-coder.com/z-index-isnt-working/#3-youre-setting-opacity-transform-or-other-css-properties-that-put-the-element-in-a-new-stacking-context
The flyouts of the menu are hidden with opacity: 0. This will put these elements into its own, new stacking context, which does not play well with #modx-content items having a z-index. This will be fine when #modx-content has a z-index: 0.
Hopefully this will solve other z-index issues too.
How to test
Compile the CSS and check some pages with tabs etc and custom manager pages like Agenda.
Related issue(s)/PR(s)
#16711 and others
#16690 and #16712 can be maybe reverted.