Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 6, 2025

The dropdown transition was broken because inline display: none/block styles were interfering with CSS transitions. When an element has display: 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:

/* Override inline display styles during transitions to allow proper CSS transitions */
.dropdown-menu.fade.showing {
  display: block !important;
}

This rule only applies when the dropdown menu has both fade and showing 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

  • All existing tests pass (1597 tests)
  • Manual testing confirmed smooth transitions for both regular and split dropdowns
  • Build and linting processes pass without issues
  • No regressions in dropdown functionality

The fix is minimal, targeted, and preserves all existing functionality while restoring smooth transitions.

Screenshots

Before fix - dropdowns work but without smooth transitions:
Dropdown before fix

After fix - smooth transitions restored:
Normal dropdown working
Split dropdown working

Fixes #2811.


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

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Co-authored-by: VividLemon <31498096+VividLemon@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] PR #2768 breaks transition in dropdown Fix dropdown transition broken by inline display styles Sep 6, 2025
@Copilot Copilot AI requested a review from VividLemon September 6, 2025 01:38
Copilot finished work on behalf of VividLemon September 6, 2025 01:38
@VividLemon VividLemon marked this pull request as ready for review September 6, 2025 01:44
Copy link

coderabbitai bot commented Sep 6, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@VividLemon VividLemon merged commit 0363c2f into main Sep 6, 2025
7 checks passed
@github-actions github-actions bot mentioned this pull request Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PR #2768 breaks transition in dropdown
2 participants