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

[AlertDialog, Dialog, Popover] Configure initial focus #732

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Oct 10, 2024

Added the initialFocus prop to control what element is focused after the Dialog, AlertDialog, or Popover is open.
By default it focuses the first element, unless the component was opened by touch interaction - in that case the popup itself is focused.

Part of #714

@michaldudak michaldudak added enhancement This is not a bug, nor a new feature component: dialog This is the name of the generic UI component, not the React module! labels Oct 10, 2024
@mui-bot
Copy link

mui-bot commented Oct 10, 2024

Netlify deploy preview

https://deploy-preview-732--base-ui.netlify.app/

Generated by 🚫 dangerJS against 6d828c4

@michaldudak michaldudak force-pushed the dialog-initial-focus branch 2 times, most recently from 3cf1d49 to 76026c0 Compare October 10, 2024 10:22
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 15, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 17, 2024
@michaldudak michaldudak changed the title [Dialog] Configure initial focus [AlertDialog, Dialog] Configure initial focus Oct 17, 2024
@michaldudak michaldudak added the component: alert dialog This is the name of the generic UI component, not the React module! label Oct 17, 2024
Copy link
Contributor

@vladmoroz vladmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • An existing bug, but just noticed that in /experiments/dialog/, in the second dialog (CSS animation example) the initial focus isn't placed into the popup at all
  • Is "" meant to be among pointer types?
  • Since pointer type includes "keyboard", should we name this argument and type differently?
image

@michaldudak michaldudak added the component: popover The React component. label Oct 21, 2024
@michaldudak michaldudak changed the title [AlertDialog, Dialog] Configure initial focus [AlertDialog, Dialog, Popover] Configure initial focus Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: alert dialog This is the name of the generic UI component, not the React module! component: dialog This is the name of the generic UI component, not the React module! component: popover The React component. enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants