NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
22 Jul 2021

Summary of Changes

In a repeatable subform we replace the X with the number of the row being created, however this is not done for the aria-describedby. This fixes that and also updates the aria-describedby tag.

Testing Instructions

  1. Login to the Joomla 4 backend
  2. Go to System -> Global Configuration
  3. Click on Users at the bottom of the list on the left
  4. Click on the Email Domain Options tab
  5. Click on the + to add a new row
  6. Inspect the Domain name input field
  7. Notice that it says <input type="text" name="jform[domains][__field10][name]" id="jform_domains____field10__name" value="" class="form-control required" aria-describedby="jform[domains][__field1X][name]-desc" required="">
  8. Apply the PR
  9. Reload the page
  10. Click on the + to add a new row
  11. Inspect the Domain name input field
  12. Notice that it now says <input type="text" name="jform[domains][__field10][name]" id="jform_domains____field10__name" value="" class="form-control required" aria-describedby="jform[domains][__field10][name]-desc" required="">

Actual result BEFORE applying this Pull Request

The aria-describedby is not updated
<input type="text" name="jform[domains][__field10][name]" id="jform_domains____field10__name" value="" class="form-control required" aria-describedby="jform[domains][__field1X][name]-desc" required="">

Expected result AFTER applying this Pull Request

The aria-describedby is updated
<input type="text" name="jform[domains][__field10][name]" id="jform_domains____field10__name" value="" class="form-control required" aria-describedby="jform[domains][__field10][name]-desc" required="">

Documentation Changes Required

None

avatar roland-d roland-d - open - 22 Jul 2021
avatar roland-d roland-d - change - 22 Jul 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jul 2021
Category JavaScript Repository NPM Change
avatar brianteeman
brianteeman - comment - 22 Jul 2021

/me confused you write aria-controlledby but the expected result shows aria-describedby

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2021

@roland-d I guess there should be a helper function to deal with all the aria-* attributes:

  • aria-labeledby
  • aria-discribedby
  • aria-controls
  • ariacontrolledby
  • ...

I mean this PR is fine but since you're doing this maybe patch all the cases in one unique way?

PS What I mean was something like:

const updateAria = (sourceElement, targetElement) => {
  [].slice.call(sourceElement.attributes)
    .filter(attribute => attribute.startsWith('aria-'))
   .map(attr => targetElement(attr, sourceElement.getAttribute(attr);
}

// Call it like
updateAria(source, target);
avatar roland-d roland-d - change - 22 Jul 2021
Title
Fixed the aria-controllerby not being set correctly
Fixed the aria-describedby not being set correctly
avatar roland-d roland-d - edited - 22 Jul 2021
avatar roland-d roland-d - change - 22 Jul 2021
The description was changed
avatar roland-d roland-d - edited - 22 Jul 2021
avatar roland-d roland-d - change - 22 Jul 2021
The description was changed
avatar roland-d roland-d - edited - 22 Jul 2021
avatar roland-d
roland-d - comment - 22 Jul 2021

@brianteeman I have no idea where that came from, but it has to be aria-describedby. I updated the text to reflect the correct name.

@dgrammatiko I don't mind doing all the cases if someone can tell me what they are and where to find them. I just found this as I am having troubles with subform and this stood out.

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2021

MDN https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA is not very helpful as there's no list with all the attributes, or I couldn't find it. Also looking at my code the .map(attr => targetElement(attr, sourceElement.getAttribute(attr); should update the target element attribute to the new state, so it needs a bit more code there...

avatar brianteeman
brianteeman - comment - 22 Jul 2021

please remember that the first rule of aria is not to use it (unless you have to)

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2021

please remember that the first rule of aria is not to use it (unless you have to)

@brianteeman you're right but we are not adding aria, we are copying/patching any existing attributes from the original form element to reflect the copied version.

avatar brianteeman
brianteeman - comment - 22 Jul 2021

was just a reminder to those that know and possibly new information for those that dont

avatar ceford ceford - test_item - 24 Jul 2021 - Tested successfully
avatar ceford
ceford - comment - 24 Jul 2021

I have tested this item successfully on cd1f121

Works as described, and the next field added is 11.


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

avatar wilsonge wilsonge - change - 27 Jul 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-07-27 18:06:36
Closed_By wilsonge
Labels Added: NPM Resource Changed ?
avatar wilsonge wilsonge - close - 27 Jul 2021
avatar wilsonge wilsonge - merge - 27 Jul 2021
avatar wilsonge
wilsonge - comment - 27 Jul 2021

Thanks!

Add a Comment

Login with GitHub to post a comment