Skip to content

Conversation

versile2
Copy link
Contributor

This change ensures that the firstChild element of the popover respects the same maximum height constraint as the popover content by setting its maxHeight to newMaxHeight instead of inherit which causes a redraw every time the mouse exits the popover.

Resolves #11667 by adjusting the max-height at the mud-list level instead of letting it inherit. When it inherits it causes a redraw which puts the top scrolled item back to the top.

You can test in PopoverFlipDirectionTest.razor with/without this change. The attached issue happens quicker and easier to reproduce since Nested Lists are separate popovers (Causing an immediate redraw every time your mouse activates a nested menu item.
Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the style of this project.
  • I've added relevant tests or tested on existing ones.

This change ensures that the `firstChild` element of the popover respects the same maximum height constraint as the popover content by setting its `maxHeight` to `newMaxHeight` instead of inherit which causes a redraw every time the mouse exits the popover.
@versile2 versile2 requested a review from Copilot July 22, 2025 20:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in MudMenu where shortened lists caused unnecessary redraws when the mouse exits the popover. The fix ensures that the first child element of the popover respects the same maximum height constraint as the popover content, preventing visual jumping where scrolled items would snap back to the top.

  • Sets explicit maxHeight on the first child element instead of relying on inheritance
  • Eliminates redraw issues that occurred when mouse interactions triggered popover updates
  • Improves user experience with nested menu navigation

@sonarqubecloud
Copy link

@versile2 versile2 changed the title MudMenu: Fix Shortened Lists MudPopover: Fix Mud List Scroll Issue Jul 22, 2025
@versile2 versile2 changed the title MudPopover: Fix Mud List Scroll Issue MudPopover: Fix MudList Scroll Issue Jul 22, 2025
@versile2 versile2 requested a review from danielchalmers July 22, 2025 20:39
@danielchalmers danielchalmers merged commit 20a3f70 into MudBlazor:dev Jul 23, 2025
7 checks passed
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.

MudMenu: unable to scroll down

2 participants