User tests: Successful: Unsuccessful:
The attribute aria-required is redundant in html5 if the required attribute is already set
http://html5doctor.com/on-html-belts-and-aria-braces/
There is one js file changes @dgrammatiko please check
There is one file still to update that I would like some help on components\com_contact\layouts\joomla\form\renderfield.php
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_categories com_redirect Layout Libraries JavaScript |
line 43. i dont understand that code enough to make the required change
So that is trying to do a weird check if the input field is required by checking for the aria-required="true"
in the input string or if there is a class required
in the input string. Given the thing can't have an aria-attribute anymore you're safe to remove that check - but I don't know if we have required class either anymore or if we've just left it to the attribute - if it's now the required attribute then we're going to need to replace that check (can be validated in the frontend by seeing if that optional string is showing)
@brianteeman is right if the required attribute is used, then the aria-required attribute is redundant (This article refers to the role attributes, but today the screen readers, NVDA and JAWS certainly announce the required attribute, so no additional aria is needed).
Here are vardumps:
$match[1]:
string(21) "form-control required"
$input:
<input
type="text"
name="jform[contact_name]"
id="jform_contact_name"
value=""
class="form-control required" size="30" required >
so this change should work:
$required = !empty($match[1]) && strpos($match[1], 'required') !== false;
The code appends (optional)
to the label when not required.
Create a mail custom field with/without required attribute.
On the frontend, load a contact form page.
Without PR, aria-required="true"
is present.
<input
type="text"
name="jform[contact_name]"
id="jform_contact_name"
value=""
class="form-control required" size="30" required aria-required="true" >
With PR, no aria-required="true"
, therefore, it should be safe to remove strpos($input, 'aria-required="true"') !== false
check.
<input
type="text"
name="jform[contact_name]"
id="jform_contact_name"
value=""
class="form-control required" size="30" required
Labels |
Added:
?
|
Category | Administration com_categories com_redirect Layout Libraries JavaScript | ⇒ | Administration com_categories com_redirect Front End com_contact Layout Libraries JavaScript |
I have tested this item
Can we get one more test please so this can be merged
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-10 23:36:23 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
Thanks
What help do you need in that layout?