-
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
Move the focus to the previously focused element for dialog.close() #6531
Conversation
Add a new `previously focused` element to dialog as a pointer to the current focused element when `dialog.showModal()` and `dialog.show()` are called, such that `dialog.close()` can use it to restore the focus. See whatwg#5678 for more details.
8959353
to
9e71dbc
Compare
Updated! |
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.
This generally looks good to me, modulo nits. Note that we hard wrap lines at a 100 columns (upon a space).
@josepharhar any final thoughts here?
I made a patch here (thanks for the WPT). If the tests pass, then I'm happy with this spec change. |
Updated the PR to address the comments. |
Thanks all! |
This change is based on the latest changes for the <dialog> element in whatwg/html#6531, such that closing <dialog> should move the focus to the previously focused element. Differential Revision: https://phabricator.services.mozilla.com/D109726 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1660271 gecko-commit: 130bfa5327532a2b188e4cc06f5e1de7183327e8 gecko-reviewers: smaug
…dialog> is closed r=smaug This change is based on the latest changes for the <dialog> element in whatwg/html#6531, such that closing <dialog> should move the focus to the previously focused element. Differential Revision: https://phabricator.services.mozilla.com/D109726
This change is based on the latest changes for the <dialog> element in whatwg/html#6531, such that closing <dialog> should move the focus to the previously focused element. Differential Revision: https://phabricator.services.mozilla.com/D109726 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1660271 gecko-commit: 130bfa5327532a2b188e4cc06f5e1de7183327e8 gecko-reviewers: smaug
Add a new
previously focused
element to dialog as a pointerto the current focused element when
dialog.showModal()
anddialog.show()
are called, such thatdialog.close()
canuse it to restore the focus.
See #5678 for more details.
cc @josepharhar @domenic @annevk
/interactive-elements.html ( diff )