[3.0] Point these labels at the fields they name - #9500
Open
albertlast wants to merge 1 commit into
Open
Conversation
Three labels in the theme carry a `for` that matches no element, so clicking them does nothing and assistive technology has no field to announce them against. The notification timeout label is a copy-paste: its text and its input are both the alert timeout, but the `for` names notify_send_body, the setting above it. That one is a single word. The two on the attachment preview cannot be fixed the same way, which is why they were left before. The block they sit in is a template that dropzone clones once per attached file, so an id on the inputs would be repeated across every preview, and a label resolves against the first match in the document - each copy would point at the first file's field rather than its own. Wrapping the input in its label associates the two with no id at all, and survives cloning. The caption moves into a span so the width that lines the two inputs up still applies to the caption alone rather than to the caption and input together. Found by walking every label[for] on twenty-five pages and resolving each id against its own document: 177 labels, one dangling. The attachment pair does not appear in that sweep because the block only exists once a file has been attached. Layout is unchanged, measured on the rendered preview before and after: the containing box 156.87x34.10, the caption 100px, the input 50.47px starting 103.66px in, caption and input on one line. Only the association changes - clicking the caption focused nothing before and focuses the input now. Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three labels in the theme carry a
forthat matches no element. Clicking them does nothing, and assistive technology has no field to announce them against.The notification timeout label is a copy-paste. Profile.template.php:1956 prints
notify_alert_timeout's text over an input withid="notify_alert_timeout", but itsfornamesnotify_send_body— the setting immediately above. One word.The two on the attachment preview could not be fixed the same way, which is why they were left out of an earlier markup change. The block they sit in is a template that dropzone clones once per attached file, so an
idon the inputs would be repeated across every preview — and a label resolves against the first match in the document, so every copy would point at the first file's field instead of its own. Wrapping the input inside its label associates the two with no id at all, and survives cloning.The caption moves into a
<span>so the width that lines the two inputs up still applies to the caption alone rather than to the caption and input together.How they were found
By walking every
label[for]on twenty-five pages and resolving each id against its own document — board index, topic, posting, five profile areas, seven admin areas, personal messages, search, memberlist, registration, reminder, login and the moderation centre:The attachment pair does not appear in that sweep because the block only exists once a file has been attached.
Layout is unchanged
Measured on the rendered preview, before and after, with the block forced visible:
The offset is what caught a first attempt: collapsing the caption and input onto one source line dropped the whitespace text node between them and moved the input 3.66px left. The space is kept.
Unrelated, but seen while testing this
Every attachment upload on
release-3.0fails outright — the preview comes back as an error box readingUnknown column 'm.id_topic' in 'field list', fromSources/Attachment.php:537. That is the bug #9459 fixes, still open. It does not affect this change, since the preview and its labels are built before the upload is attempted.Issues References (Fixes|Related|Closes)
Related #9459