-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy preview |
3cf1d49
to
76026c0
Compare
76026c0
to
8ba8514
Compare
Co-authored-by: atomiks <[email protected]> Signed-off-by: Michał Dudak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladmoroz I'll address the bug in a separate PR. An empty string is a valid value of PointerEvent's pointerType field, so I included it here as well. As for naming, yeah, I suppose we can think of something better. |
@michaldudak what does the empty string mean? What about "eventType"? "triggerType" sounds like it has to do with the trigger part |
An empty string is an unknown pointer type (see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType#value). It's not really the type of the event (as this is PointerEvent or MouseEvent), but the user's input device that caused the event to fire (= triggered it). |
Eww 😬
Do we return an empty string in this case or do we pass through the original type? |
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