Hacker News new | ask | show | jobs
by phantomread 1561 days ago
On that note, TIL about screen reader issues related to dialogs in general, including this built-in. Seems like the question is primarily around how to update the focus target from the "invoking element" to the dialog's content in a reader-friendly way. There's a linked post from the MDN docs with more detail https://www.scottohara.me/blog/2019/03/05/open-dialog.html#i.... They actually still recommend a custom implementation that's considered more robust when used with screen readers: https://github.com/KittyGiraudel/a11y-dialog. I'm glad there's a callout on the MDN docs as I would have assumed this dialog element is screen reader clean. Focus management is always a tough thing regardless.
1 comments

And this was one of the many reasons why neither Safari nor Firefox implemented <dialog>. It was only implemented in Chrome.

In 2018 Domenic Denicola mentioned that it's possible dialog should be fully removed as there's no interest in implementing it: https://github.com/whatwg/html/pull/4184#issuecomment-440405...

Fast forward to 2021, and Chrome breaks the web by removing built-in alert/prompt/confirm dialogs: https://dev.to/richharris/stay-alert-d Now the same very people, including Domenic, were arguing that alert is bad for security, bad for the Javascript engine etc. It looks like browser implementors agreed to remove those from all three browsers. Chrome was just the first.

And yet there's literally no replacement for those.

Skip to Safari 15, and we're suddenly getting <dialog> even though:

- Safari (and Mozilla) have been opposed to the current state of the spec for 10 years now

- Safari (and Mozilla) have had no interest in implementing this element as it's currently specced

- None of the decade-long issues with dialog have been fixed, including these accessibility issues

So something tells me it's there only because of the planned removal of the built-in alert/confirm/prompt, and not for any other reason.