Fix floating menu being transparent on Firefox #8859
Closed
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.
Fixes #8840
It seems
transform: translate
css that's applied via @floating-ui causes the issue on Firefox. I am not 100% sure why it gets transparent whentransform: translate
is applied but it seemstransform: translate
creates a new context that conflicts with parents' z-indexes. There is a documentation about stacking context hereFYI - this is what ChatGPT told me -
Solution
Fortunately
@floating-ui/react
library provides an option to not usetransform
property and use layout props instead. When I opted out of thetransform
flag, the issue was fixed.I upgraded
@floating-ui/react
library as part of this PR even though it was not quite necessary to fix the issue. I can roll it back if that's not desired.Screen Recording
CleanShot.2024-12-03.at.13.12.49.mp4