Skip to content

fix: forward disableFocusManagement from DialogContainer to Modal#10297

Open
momomuchu wants to merge 1 commit into
adobe:mainfrom
momomuchu:fix/dialogcontainer-disablefocusmanagement-10280
Open

fix: forward disableFocusManagement from DialogContainer to Modal#10297
momomuchu wants to merge 1 commit into
adobe:mainfrom
momomuchu:fix/dialogcontainer-disablefocusmanagement-10280

Conversation

@momomuchu

Copy link
Copy Markdown

DialogContainer accepted disableFocusManagement in name only: it was not on the prop type, not destructured, and not forwarded to Modal (which already supports it), so setting it did nothing.

This adds it to SpectrumDialogContainerProps, destructures it, and forwards it to Modal.

The test asserts that with disableFocusManagement set, focus is not restored to the trigger on close (the observable effect of the prop). It fails without the fix and passes with it. Dialog suites green, monorepo typecheck clean.

Closes #10280

DialogContainer accepted isDismissable and isKeyboardDismissDisabled and
forwarded them to the underlying Modal, but silently dropped
disableFocusManagement: it was not destructured, not declared on
SpectrumDialogContainerProps, and not passed to <Modal>. Modal (via
Overlay's disableFocusManagement prop, spread through to react-aria's
Overlay) already supports it end-to-end, so this was purely a missing
forward in DialogContainer.

Add disableFocusManagement to SpectrumDialogContainerProps, destructure
it, and forward it to Modal.

Added a regression test asserting that with disableFocusManagement set,
FocusScope's restoreFocus is skipped so focus is not automatically
restored to the trigger after the dialog closes (unlike the default
behavior). Verified RED before the fix (prop silently ignored, so
disableFocusManagement behaved identically to default) and GREEN after.

Fixes adobe#10280
@momomuchu momomuchu force-pushed the fix/dialogcontainer-disablefocusmanagement-10280 branch from 2f53b38 to 86883bf Compare July 4, 2026 14:26
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.

DialogContainer drops disableFocusManagement - not forwarded to underlying Modal

1 participant