Skip to content

[dialog] Modal behavior not preventing close on outside click. #3562

@larsenjd

Description

@larsenjd

Bug report

Current behavior

Dialog is closing on an outside click even though modal behavior enabled.

This is true whether true or 'trap-focus' is passed.

<Dialog.Root
   modal={true | 'trap-focus'}
>
   {...}
</Dialog.Root>

Expected behavior

Dialog shouldn't close on an outside click when modal behavior enabled.

Reproducible example

https://stackblitz.com/edit/awgibgiu

Base UI version

v1.0.0

Which browser are you using?

Chrome 143.0.7499.41
Firefox 146.0 (64-bit)
Brave 1.85.116 (Official Build) Chromium: 143.0.7499.110

Which OS are you using?

Windows 10 Pro
Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: dialogChanges related to the dialog component.type: expected behaviorThe current behavior is already the one expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions