Skip to content

MudPopover: Keep spawner popovers cross-axis aligned near viewport edges#13053

Merged
danielchalmers merged 2 commits intodevfrom
copilot/fix-mudselect-popover-offset
Apr 19, 2026
Merged

MudPopover: Keep spawner popovers cross-axis aligned near viewport edges#13053
danielchalmers merged 2 commits intodevfrom
copilot/fix-mudselect-popover-offset

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

MudSelect and similar spawner components could become visually detached from their trigger near viewport edges because overflow padding was clamping both axes indiscriminately. This caused horizontal drift (for vertical dropdowns) introduced with newer popover positioning behavior.

  • Positioning behavior change (mudPopover.js)

    • Added effective placement classification after flip resolution.
    • Detects whether the popover is an anchor-aligned vertical dropdown (mud-popover-top-* / mud-popover-bottom-*) or a horizontal spawner (mud-popover-center-left/right).
  • Cross-axis overflow clamp gating

    • Skipped left clamp when placement is horizontally anchor-aligned (top/bottom variants), preserving x-alignment with the trigger.
    • Skipped top clamp when placement is vertically anchor-aligned (center-left/right variants), preserving y-alignment with the trigger.
    • Kept existing overflow/flip behavior for the expansion axis and non-spawner placements.
  • Net effect

    • Dropdown-style popovers remain connected to their spawn element even near edges, while existing edge handling and flip logic remain in place.
const alignsHorizontallyToAnchor = effectiveClassListArray.some((className) =>
    className.startsWith('mud-popover-top-') || className.startsWith('mud-popover-bottom-'));

if (!alignsHorizontallyToAnchor &&
    left + offsetX < window.mudpopoverHelper.overflowPadding) {
    left = window.mudpopoverHelper.overflowPadding;
    offsetX = 0;
}

Copilot AI linked an issue Apr 15, 2026 that may be closed by this pull request
2 tasks
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor/sessions/d1aef3f2-dd54-4a9c-bec3-0f289256954d

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MudSelect popover content offset alignment Keep spawner popovers cross-axis aligned near viewport edges Apr 15, 2026
Copilot AI requested a review from danielchalmers April 15, 2026 22:50
@danielchalmers danielchalmers marked this pull request as ready for review April 15, 2026 23:00
@mudbot mudbot Bot changed the title Keep spawner popovers cross-axis aligned near viewport edges MudPopover: Keep spawner popovers cross-axis aligned near viewport edges Apr 15, 2026
@mudbot mudbot Bot added the bug Unexpected behavior or functionality not working as intended label Apr 15, 2026
@danielchalmers danielchalmers merged commit e4cf5fb into dev Apr 19, 2026
12 checks passed
@danielchalmers danielchalmers deleted the copilot/fix-mudselect-popover-offset branch April 19, 2026 13:05
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudSelect popover content offset

2 participants