Dialog focus-trap (no looping)

I have a question related to the document "No Keyboard Trap (Level A)" (
https://www.w3.org/WAI/WCAG21/Understanding/no-keyboard-trap.html)

There is a sentence:
> focus is trapped within the dialog; tabbing from the last control in the
dialog *takes focus to the first control* in the dialog.

Such behavior differs a bit from <dialog> element, which indeed prevents
setting a focus on other page elements, but it's not "looping" it (after
the last element, the focus will be moved to the browser controls, i.e the
url bar)

There was a discussion at WHATWG (https://github.com/whatwg/html/issues/8339),
should a dialog implementation be aligned with WCAG.

The conclusion was: It should be kept as it is (no looping)

But now there are some misconceptions. From a developer's point of view,
it's hard to say whether the dialog is a valid solution because it offers a
different behavior than the one described in WCAG docs.

Grzegorz

Received on Thursday, 5 September 2024 11:17:50 UTC