fix: address a11y code review findings

Bugs fixed:
- Space key was hijacked in tag input when a suggestion was
  highlighted, preventing users from typing spaces. Removed
  Space as a selection key (Enter is sufficient per combobox
  pattern).
- ArrowUp was clamped to index 0, making it impossible to
  deselect all suggestions and return to free typing. Now
  allows arrowing back to -1 which clears aria-activedescendant.

Cleanup:
- Remove dead inline onkeydown handlers from tag suggestion
  <li> elements (tabindex="-1" means they never receive focus,
  so the handlers never fire; the global keydown listener in
  app.js handles keyboard navigation).
- Add outline to aria-selected="true" state for visual parity
  with hover (keyboard users now see the same indicator).
- Announce "Ingen forslag" in live region when suggestions are
  empty (screen readers previously got silence).
- Add responsive table wrapper to admin tags and admin requests
  tables (was only on admin users).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-29 17:58:40 +02:00
commit a64d0c5dff
5 changed files with 22 additions and 13 deletions

View file

@ -7,6 +7,7 @@
{{with .Data}}
{{if .Requests}}
<div class="table-responsive" role="region" aria-label="Forespørsler" tabindex="0">
<table role="grid">
<thead>
<tr>
@ -37,6 +38,7 @@
{{end}}
</tbody>
</table>
</div>
{{else}}
<p>Ingen ventende forespørsler.</p>
{{end}}

View file

@ -7,6 +7,7 @@
{{with .Data}}
{{if .Tags}}
<div class="table-responsive" role="region" aria-label="Merkelapp-tabell" tabindex="0">
<table role="grid">
<thead>
<tr>
@ -35,6 +36,7 @@
{{end}}
</tbody>
</table>
</div>
{{else}}
<p>Ingen merkelapper ennå.</p>
{{end}}