-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Autofocus element in a <dialog> tries to get focus twice #4788
Comments
Should removing autofocus solve the problem?? |
yes. but 1) asking every author who's coded such to fix will not scale and 2) triggering the |
Is this somehow same as #4356 ? 🤔 |
This seems unrelated to #4356, which involves neither dialog nor autofocus. Some options, all based on #4763's processing model (where this will still be a problem, via a slightly different set of steps):
I don't have a strong opinion on any particular solution. I'll CC @rniwa since he has been helpful on focus thoughts from WebKit's perspective in the past. |
I don't think web developers have problems due to this behavior. This issue does't have high priority. The second bullet in @domenic's comment sounds a simple solution. We can just add a step like "If there is a dialog which is an ancestor of the element, then return" to the autofocus steps. |
If we change this we should also try to resolve #2393 while we're in the area. (Although it's unclear to me from reading that thread if there's any actual changes desired; more that we need to give the general dialog + autofocus space some thinking.) |
@tkent-google would you be up for trying to resolve this and #2393 now that #4763 is merged? |
…nside a dialog element This fixes whatwg#4788
When the dialog focusing steps are called, we prevent further autofocusing for the document. This fixes #4788. Tests: web-platform-tests/wpt#19151
The following code shows
FOCUS
log twice.input
to the document tree, and it posts the autofocus task.dialog.show()
sets focus on theinput
synchronously.input
is focused again.The text was updated successfully, but these errors were encountered: