Skip to content

feat(Dialog): configurable position (#612) - #614

Merged
mathewtaylor merged 2 commits into
v4.2.0from
foreman/ml-671
Oct 16, 2026
Merged

mathewtaylor merged 2 commits into
v4.2.0from
foreman/ml-671

Conversation

@mathewtaylor

Copy link
Copy Markdown
Contributor

Closes #612.

What changed

  • New DialogPosition enum: Center, TopCenter, BottomCenter, CenterLeft, CenterRight, TopLeft, TopRight, BottomLeft, BottomRight.
  • BbDialog.Position parameter, cascaded to BbDialogContent.
  • DialogOpenOptions.Position, used by BbDialogProvider for DialogService.OpenAsync<TComponent>() dialogs.
  • Default is Center. With no position set, a dialog gets the same classes as before.

Notes

  • Edge positions sit 1rem from the viewport edge. Side and corner positions use w-[calc(100%-2rem)] so they keep that gutter on narrow screens.
  • Edge positions also set the opposite inset to auto. A native <dialog> opened with showModal() gets inset: 0 from the browser, and without this it would stay top-left.

Docs

  • Demo section "Position" on the Dialog page, with a position.txt snippet.
  • API Reference entries for Dialog.Position and DialogOpenOptions.Position.
  • API surface snapshot updated.

Tests

  • New DialogPositionTests (bUnit): default stays centred, and an explicit position applies, for both BbDialog and DialogService.
  • Ran with the API surface tests and the existing dialog-related tests.

Dialog takes a Position parameter (DialogPosition: Center, TopCenter,
BottomCenter, CenterLeft, CenterRight, TopLeft, TopRight, BottomLeft,
BottomRight). DialogService dialogs take the same value through
DialogOpenOptions.Position. Center stays the default, so dialogs that
don't set it are unchanged.

Adds a demo section, code snippet and API Reference entries, and
updates the API surface snapshot.
@mathewtaylor
mathewtaylor marked this pull request as ready for review October 16, 2026 01:26
…n check

DialogPosition names physical sides (CenterLeft, TopRight, ...), the same
way ToastPosition does, so its placement classes stay physical.
@mathewtaylor
mathewtaylor merged commit 2c3fdb0 into v4.2.0 Oct 16, 2026
1 check passed
@mathewtaylor
mathewtaylor deleted the foreman/ml-671 branch October 16, 2026 02:10
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.

1 participant