Re: ACTION-2290: Review decision on dialog close focus location (https://github.com/whatwg/html/issues/5678) due may 12, 2021 (Accessible Platform Architectures Working Group)

The intent to manage focus of a closing dialog is a good one. However, if
authors have a clear understanding of the process they should have the
ability to change the focus target on dialog.close().

A common example: a dialog created for the "confirm delete" action with
"confirm" and "cancel" buttons. Cancel can target the default element per
this spec (i.e., the "delete" button). Confirm would send focus to
body since the deleted item no longer exists. An author should have the
ability to override this behavior but programmatically setting focus could
introduce a race condition with the default behavior.

Possible solutions:

   - the addition of a dialog property, with an idref value, that will
   override this behavior by targeting the specified element when present
   provided the element exists and is connected to the dom.
   - an options object or flag passed to dialog.close() that overrides the
   default behavior.

Received on Wednesday, 12 May 2021 13:40:46 UTC