Skip to content

MudSelect, MudAutocomplete, MudMenu: Fix modeless overlay reopen on same activator click#12870

Merged
danielchalmers merged 1 commit intoMudBlazor:devfrom
danielchalmers:grotesque-crane
Mar 17, 2026
Merged

MudSelect, MudAutocomplete, MudMenu: Fix modeless overlay reopen on same activator click#12870
danielchalmers merged 1 commit intoMudBlazor:devfrom
danielchalmers:grotesque-crane

Conversation

@danielchalmers
Copy link
Member

@danielchalmers danielchalmers commented Mar 17, 2026

Fixes a modeless overlay interaction bug affecting MudSelect, MudAutocomplete, and MudMenu.

In modeless mode, overlay auto-close runs on pointerdown. When the component was already open and the user clicked its activator again, the overlay could close on pointerdown and then immediately reopen on the activator click.

This change prevents modeless overlay auto-close from triggering when the pointer event originated inside the owning component’s activator/root area.

What changed:

  • Updated modeless overlay hit-testing in mudPointerEventsNone.js to ignore pointer events originating from an explicitly marked owner element.
  • Wired the owner element for:
    • MudSelect
    • MudAutocomplete
    • MudMenu
  • Added targeted regression tests covering the new ignore-region wiring.

Related:

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

Fixes a modeless overlay interaction bug affecting `MudSelect`, `MudAutocomplete`, and `MudMenu`.

In modeless mode, overlay auto-close runs on `pointerdown`. When the component was already open and the user clicked its activator again, the overlay could close on `pointerdown` and then immediately reopen on the activator click.

This change prevents modeless overlay auto-close from triggering when the pointer event originated inside the owning component’s activator/root area.

## What changed

- Updated modeless overlay hit-testing in `mudPointerEventsNone.js` to ignore pointer events originating from an explicitly marked owner element.
- Wired the owner element for:
  - `MudSelect`
  - `MudAutocomplete`
  - `MudMenu`
- Added targeted regression tests covering the new ignore-region wiring.
@mudbot mudbot bot changed the title Fix modeless overlay reopen on same activator click MudSelect, MudAutocomplete, MudMenu: Fix modeless overlay reopen on same activator click Mar 17, 2026
@mudbot mudbot bot added the bug Unexpected behavior or functionality not working as intended label Mar 17, 2026
@danielchalmers danielchalmers added the regression Previously worked and now doesn't label Mar 17, 2026
Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

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

Nice work. LGTM Tested as many examples as I could reproduce and all pass this change. Tested both BSS and WASM.

V

@danielchalmers danielchalmers merged commit 9ad260c into MudBlazor:dev Mar 17, 2026
12 checks passed
@danielchalmers danielchalmers deleted the grotesque-crane branch March 17, 2026 16:07
This was referenced Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended regression Previously worked and now doesn't

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudMenu: Clicking activator of open menu does not close menu

3 participants