? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
4 Jul 2018

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

avatar brianteeman brianteeman - open - 4 Jul 2018
avatar brianteeman brianteeman - change - 4 Jul 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jul 2018
Category Administration com_categories com_redirect Layout Libraries JavaScript
avatar wilsonge
wilsonge - comment - 4 Jul 2018

What help do you need in that layout?

avatar brianteeman
brianteeman - comment - 4 Jul 2018

line 43. i dont understand that code enough to make the required change

avatar wilsonge
wilsonge - comment - 4 Jul 2018

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)

avatar brianteeman
brianteeman - comment - 5 Jul 2018

@wilsonge I can not even see where that is used

avatar zwiastunsw
zwiastunsw - comment - 5 Jul 2018

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

avatar Quy
Quy - comment - 5 Jul 2018

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;

avatar brianteeman
brianteeman - comment - 5 Jul 2018

@Quy @wilsonge I dont like removing any code unless i can see what its doing (or not)
I would assume that this code was adding the aria attribute but its not. In which case what is the code doing - if anything at all

avatar Quy
Quy - comment - 5 Jul 2018

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.

avatar brianteeman
brianteeman - comment - 5 Jul 2018

@Quy thanks I hadnt looked at custom fields. However it still never added the aria required ??

avatar Quy
Quy - comment - 5 Jul 2018

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      
avatar brianteeman brianteeman - change - 5 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jul 2018
Category Administration com_categories com_redirect Layout Libraries JavaScript Administration com_categories com_redirect Front End com_contact Layout Libraries JavaScript
avatar Quy Quy - test_item - 5 Jul 2018 - Tested successfully
avatar Quy
Quy - comment - 5 Jul 2018

I have tested this item successfully on 5510c5e


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

avatar brianteeman
brianteeman - comment - 6 Jul 2018

Can we get one more test please so this can be merged

avatar zwiastunsw zwiastunsw - test_item - 7 Jul 2018 - Tested successfully
avatar zwiastunsw
zwiastunsw - comment - 7 Jul 2018

I have tested this item successfully on 592b80f


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Jul 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Jul 2018

Ready to Commit after successful tests.

avatar wilsonge wilsonge - change - 10 Jul 2018
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: ?
avatar wilsonge wilsonge - close - 10 Jul 2018
avatar wilsonge wilsonge - merge - 10 Jul 2018
avatar wilsonge
wilsonge - comment - 10 Jul 2018

Thanks!

avatar brianteeman
brianteeman - comment - 11 Jul 2018

Thanks

Add a Comment

Login with GitHub to post a comment