User tests: Successful: Unsuccessful:
The library file libraries\src\Form\Field\CheckboxField.php generates invalid markup by adding a blank label for the checkbox (the code in the component already creates a valid label)
This blank label is a problem for a11y as it is a label for nothing and as it occurs multiple times on the page assistive technology thinks that there also multiple fields with the same label.
As far as I can see this is only used in mass mail users (/administrator/index.php?option=com_users&view=mail) for the bcc fields etc
Testing is easiest by viewing the generated source of the page before and after the patch
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
What do meam with:
the code in the component already creates a valid label
the valid label is created here
Before PR, 2 labels per field:
<div class="control-group">
<div class="form-check"><label class="form-check-label"><input type="checkbox" name="jform[recurse]" id="jform_recurse" value="1" class="form-check-input"></label></div> <label id="jform_recurse-lbl" for="jform_recurse">
Mail to Child User Groups</label>
</div>
After PR, 1 label per field.
<div class="control-group">
<div class="form-check"><input type="checkbox" name="jform[recurse]" id="jform_recurse" value="1" class="form-check-input"></div> <label id="jform_recurse-lbl" for="jform_recurse">
Mail to Child User Groups</label>
</div>
that label is there for styling purposes ?
this change will break existing custom styling, is this B/C ?
Can it be done the same way that it is done for multiple checkboxes field ?
which is using a fieldset for the main label and then a label for every individual checkbox
the markup is wrong - simple as that - any other consideration is irrelevant
i did not say that existing is correct
i offered an alternative and asked if it is a good one (it is ?),
and the solution i suggested is already use for checkboxes and radio-sets (and other fields ?)
but also please consider this,
if this can be addressed the same way that we are doing for multiple checkboxes field
then it would mean that the multiple checkboxes field markup is bad too ?
and about simple facts:
this change breaks any customized display of the field that depends label
that label is there for styling purposes ?
The current markup structure is wrong even by the Bootstrap documentation.
this change will break existing custom styling, is this B/C ?
The current markup structure has already changed in relation to 3.x so the B/C concern is irrelevant.
then it would mean that the multiple checkboxes field markup is bad too ?
This is correct. That layout needs updating to render the input outside the label element.
The current markup structure is wrong even by the Bootstrap documentation.
The current markup structure has already changed in relation to 3.x so the B/C concern is irrelevant.
we posted at same time, yes if course current markup is wrong
but i have made some other points too
Regarding multiple checkboxes field markup
then it would mean that the multiple checkboxes field markup is bad too ?
This is correct. That layout needs updating to render the input outside the label element
yes, agreed
even if we ignore B/C it makes custom styling of the input harder
That's just hogwash
even if we ignore B/C it makes custom styling of the input harder
That's just hogwash
i will not compete in English literature here , i will loose
i would expect that you would ask what i meant with it
you see even if you are thinking of using ::before of ::after pseudo classes , there is a problem ... the checkboxes that will also have labels after the input so you will also need CSS not followed by and possibly CSS :not() for parent container too
thus you will end up doing some somewhat hacky CSS staff
and also if you want to use a ready-made framework it will not work out of the box
but anyway it is possible, i just said it is harder , whatever
What about the point that it is not consistent to solution used for multiple checkboxes and radio-sets fields ?
hogwash === complete rubbish
your comment on the css is exactly that - i can only assume you are commenting without actually testing
... you will also need CSS not followed by ...
spoiler, (whatever you call it) there is no such thing to style the previous element on not having an element after it, thus you will need to have a requirement on the CSS class of the parent container in the CSS rules
but the important is not about being difficult or easy but
that it will be ugly and different with CSS for multiple checkboxes and radios
and
any that any ready CSS / JS framework will not work out of the box
I am not debating it any further - the markup is invalid. invalid markup is wrong.
we can agree on the last comment
i am not debating this any further either
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-16 10:00:48 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks guys!
thank you
I have tested this item✅ successfully on df81d55
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21127.