Closed Bug 1660271 Opened 4 years ago Closed 3 years ago

Move the focus back to the previous focused element for dialog.close()

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Accessibility Severity s3
Tracking Status
firefox90 --- fixed

People

(Reporter: sefeng, Assigned: sefeng)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: , [wptsync upstream])

Attachments

(1 file)

Per discussion in https://github.com/whatwg/html/issues/5678, browser vendors agree that we should move the focus back to previously focused element upon dialog.close(). This improves the a11y support of dialog, so that we can enable <dialog> in Release.

We'll start with By default, dialog.close() returns the focus to the previously focused element if the element is still focusable and within the viewport, otherwise move the focus to <body>;

(Web developers should be able to use the close event to move the focus to a different element if they want)

Keywords: access
Whiteboard: [access-s3]

This change is based on the agreement that browser vendors are maded
in https://github.com/whatwg/html/issues/5678, such that closing
<dialog> should move the focus to the previously focused element.

Assignee: nobody → sefeng
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:sefeng, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(sefeng)
Flags: needinfo?(bugs)
Flags: needinfo?(bugs)
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/130bfa532753
Move the focus to the previously focused element when <dialog> is closed r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28749 for changes under testing/web-platform/tests
Whiteboard: [access-s3] → [access-s3], [wptsync upstream]
Flags: needinfo?(sefeng)
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1709233
Regressions: 1724816
Accessibility Severity: --- → s3
Whiteboard: [access-s3], [wptsync upstream] → , [wptsync upstream]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: