Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dialog, Popover, Menu, Select] Modality changes #623

Open
vladmoroz opened this issue Sep 16, 2024 · 0 comments
Open

[Dialog, Popover, Menu, Select] Modality changes #623

vladmoroz opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
component: dialog This is the name of the generic UI component, not the React module! component: menu This is the name of the generic UI component, not the React module! component: popover The React component. component: select This is the name of the generic UI component, not the React module!

Comments

@vladmoroz
Copy link
Contributor

vladmoroz commented Sep 16, 2024

Dialogs

  • Tab keypresses loop focus regardless of the modal prop value
    • modal will only mean "pointer" modality going forwards, which includes preventing outside clicks and scroll locking
    • Tabbing out should never close the popup
    • Focus is not trapped per se, it should still be able to escape the non-modal non-dismissible popups (for example, in Figma's non-dismissible popups keyboard focus is looped, but can be moved outside of the popup via pointer interactions).
  • Backdrop part becomes optional and is only for presentation
    • Outside clicks should be prevented regardless of whether Backdrop is present
  • Expose reason argument in onOpenChange to make it possible to prevent close on interactions like Esc keypress

Popover

  • modal prop is added, false by default. Modality should work exactly the same as in dialogs.
    • The final decision re. whether default is true/false is contingent on whether touch should be treated as always modal
    • Popovers that open on hover shouldn't steal current focus so that you can "unhover" the trigger; however, once focus is manually placed into such popover, keyboard focus is looped normally.
    • We need to explore/research how to make it work with touch screen readers if an explicit close button isn't rendered

Menu, Select

  • modal prop is added, false by default
    • Same as popovers re. the final decision re. whether default is true/false
    • Menus should still close on the first Tab keypress
  • Menus that open on hover also shouldn't steal focus until it's placed into the popup manually via hovering an item or arrow keypress

Context:
https://www.figma.com/design/Y6VArf17CAhMUc1DBWKHIi/Modality?node-id=0-1&t=kN6j5qsqKlWGNn1B-1
https://www.notion.so/mui-org/Vlad-James-modality-107cbfe7b66080f5a68cfd7450da9433?pvs=4

@vladmoroz vladmoroz added the component: dialog This is the name of the generic UI component, not the React module! label Sep 16, 2024
@vladmoroz vladmoroz changed the title [dialog] Modality changes [dialog, popover, menu, select] Modality changes Sep 27, 2024
@vladmoroz vladmoroz added component: select This is the name of the generic UI component, not the React module! component: menu This is the name of the generic UI component, not the React module! component: popover The React component. labels Sep 27, 2024
@michaldudak michaldudak changed the title [dialog, popover, menu, select] Modality changes [Dialog, Popover, Menu, Select] Modality changes Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module! component: menu This is the name of the generic UI component, not the React module! component: popover The React component. component: select This is the name of the generic UI component, not the React module!
Projects
Status: In progress
Development

No branches or pull requests

2 participants