The label should probably be assigned to the 'select' field.
Labels |
Added:
?
|
@zwiastunsw the id on the select element there is wrong
@brianteeman what do you mean most custom elements have the same issue? It might be a bug in the id as in the example above but there is no fundamental problem with form fields inside a custom element:
Check the switcher,fancy-field-select and media custom field and the field used for article selection eg Article Associations (might not be a custom field (?)
The label is not associated with the field
Erm, I'm just showcasing the media custom field above...
sorry that one is ok - I was using edge as the browser and it presents the a11y tree in a different way and I misread it for that one. the other two are correct reports.
PS the real easy giveaeway without checking the accessibiity tree is that you should be able to click on the field label and the browser will highlight the field input
I have identified the same problem on many pages. In order not to assume new issues, here is a list of detected cases:
@zwiastunsw can you update the list please as I think some of them have been resolved in the #23919
As far as I can tell it is just the switcher fields that need fixing. Can you suggest what the html should be and I can fix that
As you can see, there were no switches in the list above. Because this is a separate topic.
Label
tag cannot be applied to a fieldset
. See:
The
<label>
tag defines a label for a<button>
,<input>
,<meter>
,<output>
,<progress>
,<select>
, or<textarea>
element. HTML Tag
The easiest way seems to me to add a legend tag inside the fieldset tag.
So who should look like that:
<fieldset class="switcher success active has-success" tabindex="0" id="jform_params_show_on_article_page" aria-checked="true" role="switch" aria-labeledby="jform_params_show_on_article_page-lbl">
<legend class=" ...." >Show on Article Page</legend>
<input type="radio" id="jform_params_show_on_article_page0" name="jform[params][show_on_article_page]" value="0" tabindex="-1" class="valid form-control-success" aria-invalid="false">
<input type="radio" id="jform_params_show_on_article_page1" name="jform[params][show_on_article_page]" value="1" checked="checked" class="active" tabindex="-1">
<span class="switch success"></span>
</fieldset>
OK I can work on that. I was struggling with finding out how to do the mark up - but the legend seems a good approach with a class of sr-ony
I will work on that.
I thought rather about replacing the current label
tag with a legend
tag. Label
tag is not correct here. It contains a label, but this label is not assigned to any element. Its relationship with the switch is only visual.
@dgrammatiko just realised that this switcher is all js - not my area ;)
@zwiastunsw @brianteeman decide what the markup should be and I'll do the changes
I am happy with the legend idea. A fieldset is supposed to have one anyway
My opinion: legend
tag instead of label
You will need to style like a label. (@dgrammatiko
Replacing the label with a legend wont work.
We render the label and the input separately not as one single input so in this case the legend tag will be outside of the fieldset which is not valid
@brianteeman the legend will be a child of the fieldset not outside. The styling needs to be adjusted so it looks like a label, so not changing the markup, just some fancy styling
but you would then need to change the renderfield code to not output a label
@brianteeman there is already an option in the codebase for this
<?php if (empty($options['hiddenLabel'])) : ?>
<div class="control-label"><?php echo $label; ?></div>
<?php endif; ?>
So we just add hiddenLabel="true" in the xml for the switch, or even better we do that in the field itself
@dgrammatiko : Note. Remember to correctly add aria-describedby
to the switcher (to fieldset
in this cause). On the Banner new/edit page there is a switcher with a hint.
aria-describedby
should point to legend, right?
no to legend, to fieldset
I've merged that to unblock here
Not really. That field will have to be done by someone else in another pr. You don't want me writing JavaScript
Status | New | ⇒ | Discussion |
Category | ⇒ | Accessibility |
Labels |
Added:
J4 Issue
|
Labels |
Added:
?
|
Category | Accessibility | ⇒ |
Title |
|
Title |
|
Looks like the problem with the fields identified in the original post is that they are all joomla-field-fancy-select
Other identified fields that exhibit the problem are those with select buttons. Like select a category. I have a fix in preparation for those.
@zwiastunsw please update this so that I can know if there are any more to fix
I'm very busy until June 12th. I'm sory
@zwiastunsw still busy?
I'm here. Today I did my first tests. :)
What's the version I'm supposed to use for testing? Because today I did the same tests twice for the Backend template...
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-08-05 04:09:07 |
Closed_By | ⇒ | franz-wohlkoenig | |
Labels |
Added:
?
|
Most of the custom elements have the same problem. I did raise this previously