Settings > Appearance: the career order checkbox points aria-describedby at a help text with no id #207
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CI's browser suite fails on
main:What is wrong
Django renders the Show the order number on each career entry checkbox with
aria-describedby="id_show_career_order_helptext", because the field has help text. Nothing on the page has that id, so a screen reader is told the checkbox is described by an element that does not exist, and the sentence explaining the preference cannot be reached from the checkbox. This is the same dangling reference #114 removed from every other form.Why
src/postulo/templates/settings/appearance.html, in the Your career card added by #203 (0e76bab12):The template draws the help text itself, inside the label, so it passes
errors_only=Trueto stoppartials/field_feedback.htmldrawing it a second time. That is the right call, buterrors_onlyis for a caller that "has already drawn the help itself ... and has put the id on it" (the partial's own comment). This caller drew it without the id. The Navigation fieldset a few lines above in the same template does it correctly:id="{{ form.navigation.auto_id }}_helptext".Fix
Put
id="{{ form.show_career_order.auto_id }}_helptext"on the help-text span. The help stays inside the<label>, so it will also be part of the checkbox's accessible name. If a name and a description that repeat each other read badly, move the span out of the label and keep the id on it.tests/e2e/test_described_by.pyalready covers this and should pass again once the fix lands. No new test is needed. Ideally a unit-level check would also catch it, so a template like this fails the fast suite and not only the five-minute browser walk.