4 ms·
> it would be great if the HTMX documentation included worked examples and guidance for how to do this. The htmx documentation does include examples with acces
by yawaramin 2y ago
> it would be great if the HTMX documentation included worked examples and guidance for how to do this.
The htmx documentation does include examples with accessibility guidance. Eg https://htmx.org/examples/bulk-update/ https://htmx.org/examples/bulk-update/
> The server will bulk-update the statuses based on the values of the checkboxes. We respond with a small toast message about the update to inform the user, and use ARIA to politely announce the update for accessibility.
If you check the Server Requests panel it also shows the responses and the ARIA attribute they include.
EDIT: I've submitted a PR to fix the notification toast announcement, with this the screen reader announces the notification correctly: https://github.com/bigskysoftware/htmx/pull/3112 https://github.com/bigskysoftware/htmx/pull/3112
The key is to mark all live regions statically before doing any htmx requests, then injecting the response HTML inside those regions. Then they are announced by the screen reader. This is nothing special to htmx of course; every app needs to work the same way.