? ? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
2 Jun 2019

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.

Testing

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

Before

<div class="control-group">
	<div class="controls">
		<input type="text" name="jform[test]" id="jform_test" value="" class="form-control">
	</div>
</div>

After

<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>
avatar brianteeman brianteeman - open - 2 Jun 2019
avatar brianteeman brianteeman - change - 2 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jun 2019
Category Layout
avatar richard67
richard67 - comment - 2 Jun 2019

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.

avatar richard67 richard67 - test_item - 2 Jun 2019 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Jun 2019
Title
[4.0] Render label [a11y]
[4.0] Render label
avatar franz-wohlkoenig franz-wohlkoenig - edited - 2 Jun 2019
avatar brianteeman brianteeman - change - 2 Jun 2019
Labels Added: ? ?
avatar richard67
richard67 - comment - 2 Jun 2019

I have tested this item successfully on de6db06


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25085.

avatar richard67 richard67 - test_item - 2 Jun 2019 - Tested successfully
avatar Quy
Quy - comment - 2 Jun 2019

I have tested this item successfully on de6db06


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25085.

avatar Quy Quy - test_item - 2 Jun 2019 - Tested successfully
avatar Quy Quy - change - 2 Jun 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 2 Jun 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25085.

avatar brianteeman brianteeman - change - 2 Jun 2019
Labels Added: ? ?
Removed: ?
avatar richard67
richard67 - comment - 2 Jun 2019

I have tested this item successfully on faa2a56


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25085.

avatar richard67 richard67 - test_item - 2 Jun 2019 - Tested successfully
avatar brianteeman brianteeman - change - 2 Jun 2019
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 3 Jun 2019
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: ?
avatar wilsonge wilsonge - close - 3 Jun 2019
avatar wilsonge wilsonge - merge - 3 Jun 2019
avatar wilsonge
wilsonge - comment - 3 Jun 2019

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...)

avatar brianteeman
brianteeman - comment - 3 Jun 2019

Thanks

Add a Comment

Login with GitHub to post a comment