renderers: honor show_label and label_class on checkbox labels - #891
Merged
Merged
Conversation
dyve
force-pushed
the
fix/127-checkbox-label
branch
from
September 20, 2026 14:43
486935d to
5f0e1c9
Compare
add_checkbox_label hardcoded label_class="form-check-label" and never looked at show_label, so both parameters were silently dropped for checkboxes while working everywhere else. In horizontal layout that left a visible label next to the checkbox even though the outer label had already been reduced to sr-only. show_label now follows the same rules as get_label_class: False and 'sr-only' add sr-only, 'skip' omits the label. label_class extends form-check-label rather than replacing it, because that class is structural Bootstrap markup. Rendered output only changes for callers that pass show_label or label_class on a checkbox. Fixes #127 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dyve
force-pushed
the
fix/127-checkbox-label
branch
from
September 20, 2026 14:45
5f0e1c9 to
414f2ab
Compare
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.
add_checkbox_labelhardcodedlabel_class="form-check-label"and never looked atshow_label, so both parameters were silently dropped for checkboxes while working everywhere else. In horizontal layout that left a visible label next to the checkbox even though the outer label had already been reduced tosr-only, which is exactly the markup in #127.A new
get_checkbox_label_classfollows the same rules asget_label_class:show_label=Falseandshow_label='sr-only'addsr-only, andshow_label='skip'omits the label entirely, matching whatget_labelalready does for other fields.label_classextendsform-check-labelrather than replacing it, because that class is structural Bootstrap markup that the checkbox needs to lay out at all. That is the one judgement call here and the place to push back: for non-checkbox fieldslabel_classreplaces, so this is deliberately not symmetrical.Rendered output changes only for callers that pass
show_labelorlabel_classon a checkbox.Fixes #127
🤖 Generated with Claude Code