User tests: Successful: Unsuccessful:
There is an option "hiddenLabel" for a form field. But instead of "hiding" the label it doesn't render the label at all. This causes accessibility issues because every form field input must have an associated label.
This PR changes it so that instead of the label not being rendered at all it is rendered with a class of sr-only instead.
Add the following field to any form
<field
name="test"
type="text"
label="Hidden"
hiddenLabel="true"
/>
Before and After applying the PR there will be no visual change BUT if you view the source you will see that the code has changed
<div class="control-group">
<div class="controls">
<input type="text" name="jform[test]" id="jform_test" value="" class="form-control">
</div>
</div>
<div class="control-group">
<div class="control-label sr-only">
<label id="jform_test-lbl" for="jform_test">Hidden</label>
</div>
<div class="controls has-success">
<input type="text" name="jform[test]" id="jform_test" value="" class="form-control valid form-control-success" aria-invalid="false">
</div>
</div>
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
Title |
|
Labels |
Added:
?
?
|
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
?
Removed: ? |
I have tested this item
Labels |
Added:
?
Removed: ? |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-03 14:32:50 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
Removed: ? |
Added docs required because technically we have a b/c break here requiring the label on hiddenLabel fields (I think the chances are low anyone's doing that but anyhow...)
Thanks
I have tested this item✅ successfully on f855283
I tested this with the TinyMCE editor plugin, which has such a field (field with name="configuration" in fieldset with name="basic").
Without this PR, the field is not rendered. With this PR, it is rendered with sr-only class.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25085.