[1.x] Fix inability to click dropdown content in React version #153
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.
This PR fixes an issue where the content inside a dropdown (e.g. the "Log Out" link) was unable to be clicked in the React version of Breeze.
The "click away" element (used to trigger the closing of the dropdown when clicking away from it) was covering the dropdown menu, so when you think you are clicking the dropdown, you are actually hitting the click-away element, even though the dropdown has a higher z-index.
This is because the Headless UI
Transition
component creates a wrapper div by default. The wrapper div hastransform
andopacity
properties which create a new z-index stacking context.A solution is to tell the
Transition
component to render as aFragment
which does not render an additional DOM node:This is also how Vue's
<transition>
component works by default.I also removed the additional "open" logic because the fragment requires a child node to exist unconditionally, and the
show
attribute on the<Transition>
element already controls the visibility.