? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
2 May 2019

The following fields were identified by @zwiastunsw as not having labels associated with the element

There were TWO different problems that this PR fixes

  1. the label was being associated with the hidden input and not the visible input
  2. The visible input was set to disabled - it should have been readonly because

When applied to a form field, the disabled attribute means that the field does not receive focus. resulting in the screen reader ignoring the field and not announcing the value of the field

Basically the fields that look like
image

Menus: Edit Item page, Single Article menu item type
Details tab: Select Article field

Menus: Edit Item page, Category blog menu item type
Details tab: Choose a Category field

Menus: Edit Item page, Single Contact menu item type
Details tab: Select Contact field

Menus: Edit Item page, Contact Single Category menu item type
Details tab: Select a Category field

Menus: Edit Item page, Single News Feed menu item type
Details tab: Feed field

avatar brianteeman brianteeman - open - 2 May 2019
avatar brianteeman brianteeman - change - 2 May 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2019
Category Administration com_categories com_contact com_content com_newsfeeds
avatar brianteeman brianteeman - change - 2 May 2019
The description was changed
avatar brianteeman brianteeman - edited - 2 May 2019
avatar brianteeman brianteeman - change - 2 May 2019
Title
Disabled
[4.0] Modal select fields [a11y]
avatar brianteeman brianteeman - edited - 2 May 2019
avatar brianteeman brianteeman - change - 2 May 2019
Labels Added: ?
avatar wilsonge
wilsonge - comment - 2 May 2019

This is more complicated. There’s a technical difference too. Disabled means the field isn’t submitting. So the readonly attribute means it is submitting which is undesired. We only want the hidden field to be submitting the data

avatar brianteeman
brianteeman - comment - 2 May 2019

Disabled also means the field should be skipped in the tab order which is why the screen reader never sees it. It might be submitted but what is it submitting? It can only be submitting exactly the same as the hidden field. As both fields have different id then surely we are already only storing the submitted values of the hidden field???

Have to ask though why we have a hidden field in the first place?

avatar franz-wohlkoenig franz-wohlkoenig - change - 3 May 2019
Title
[4.0] Modal select fields [a11y]
[4.0] Modal select fields
avatar franz-wohlkoenig franz-wohlkoenig - edited - 3 May 2019
avatar SharkyKZ
SharkyKZ - comment - 3 May 2019

Hidden field holds the value/ID that is sent to the server. Text field just displays the name of selected item to the user.

@wilsonge True, but that shouldn't be an issue if input has no name attribute?

avatar wilsonge
wilsonge - comment - 4 May 2019

I can't find any docs on that either way. The HTML5 spec says that name is optional but doesn't tell browsers how to handle it when that is missing. I think practically speaking it's true it won't be submitted when it's missing but it's definitely not a given either.

As for why it's hidden it's as @SharkyKZ says. The value being submitted isn't the name of the article it's the id. The disabled field is sending the title of the newsfeed/article etc

avatar SniperSister
SniperSister - comment - 4 May 2019

As discussed with @wilsonge: securitywise I have no concerns with the PR

avatar wilsonge
wilsonge - comment - 4 May 2019

Good to continue then @brianteeman

avatar brianteeman
brianteeman - comment - 4 May 2019

After that small diversion its all good to go then. Just needs tests. Nothing else from me

avatar sanderpotjer
sanderpotjer - comment - 4 May 2019

I have tested this item successfully on df3755c

There are some JS formvalidator issues when creating a new article via the Modal select fields, but that does not seem to be related to the changes of this PR.


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

avatar sanderpotjer
sanderpotjer - comment - 4 May 2019

I have tested this item successfully on df3755c

There are some JS formvalidator issues when creating a new article via the Modal select fields, but that does not seem to be related to the changes of this PR.


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

avatar sanderpotjer sanderpotjer - test_item - 4 May 2019 - Tested successfully
avatar euismod2336
euismod2336 - comment - 4 May 2019

I have tested this item successfully on df3755c


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

avatar euismod2336 euismod2336 - test_item - 4 May 2019 - Tested successfully
avatar wilsonge wilsonge - change - 4 May 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-05-04 12:06:26
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 4 May 2019
avatar wilsonge wilsonge - merge - 4 May 2019
avatar wilsonge
wilsonge - comment - 4 May 2019

Thanks guys!

avatar brianteeman
brianteeman - comment - 4 May 2019

Thanks

avatar infograf768
infograf768 - comment - 29 May 2019

This has changed drastically the id of the label, using _name instead of _id and therefore breaking some js as associations-edit.js
It took me some hours to find out what was broken and I can solve the js easily with a PR but I wonder if this is B/C.

Could someone explain in simple terms why this specific change ?
For example I get:
<label id="jform_associations_de_DE_name-lbl"
instead of
<label id="jform_associations_de_DE_id-lbl"

If it IS absolutely necessary then we should have some documentation about it.

avatar brianteeman
brianteeman - comment - 29 May 2019

Before the markup was incorrect as it said label for= something that didnt exist
image

Now the markup is correct and correctly associates the label with the input
image

avatar infograf768
infograf768 - comment - 30 May 2019

See #25060
I still think that this change should be documented.

Add a Comment

Login with GitHub to post a comment