Fix dropdown transition broken by inline display styles #2832
+5
−0
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.
The dropdown transition was broken because inline
display: none/block
styles were interfering with CSS transitions. When an element hasdisplay: none
, CSS transitions cannot work properly as the element is immediately removed from the layout.Problem
The BDropdown component was setting inline styles with
{display: showRef ? 'block' : 'none'}
which prevented smooth CSS transitions from working. This caused dropdown menus to appear and disappear abruptly without any fade or transition effects.Solution
Added a targeted CSS rule that overrides the inline display style specifically during transition states:
This rule only applies when the dropdown menu has both
fade
andshowing
classes, which are present during CSS transitions. This allows the transition animations to work properly while maintaining the correct display behavior in non-transition states.Testing
The fix is minimal, targeted, and preserves all existing functionality while restoring smooth transitions.
Screenshots
Before fix - dropdowns work but without smooth transitions:

After fix - smooth transitions restored:


Fixes #2811.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.