←back to thread

Just use a button

(gomakethings.com)
286 points moebrowne | 1 comments | | HN request time: 0.225s | source
Show context
827a ◴[] No.45774815[source]
> This element does not announce itself as an interactive element to screen reader users.

Is this actually true nowadays? Given that advice like this is often parrotted by people who don't actually use screen-reading software, I sometimes wonder if this is a situation where we've just been saying this and repeating this advice; meanwhile, screen readers have obviously become sophisticated enough to recognize that a div with an onclick handler on it is probably, you know, clickable and interactive.

replies(4): >>45774839 #>>45774920 #>>45775050 #>>45775209 #
pverheggen ◴[] No.45775209[source]
There are well-defined standards for how the role of every element is determined, and according to those standards, adding an onclick handler does not change the role.

Screen readers also don't access the DOM directly, there's an extra abstraction layer. Browsers expose accessibility data to the appropriate OS API, and screen readers use the data exposed by the OS. There's too much variation as-is between different screen readers to be piling browser-specific behavior on top.

replies(1): >>45787573 #
1. 827a ◴[] No.45787573[source]
Maybe. But, again, these are all hypothetical ideas. Its been over 24 hours, and despite getting multiple responses, none of them are of the form: "I have used ScreenReaderSoftwareX, and on the latest version it does not interpret divs with an onclick handler has an interactable entity even though it is".