-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Filtered item information [a11y] #28997
Conversation
Add a space after |
output is now Table of Contacts, Sorted by: Title - descending, Filtered by: Status: Published
…ter value Table of Contacts, Sorted by: Title - descending, Filtered by: Status - Published
captionContent = `${element.labels[0].textContent} - ${element.options[element.selectedIndex].text}`; | ||
} | ||
|
||
document.getElementById('filteredBy').textContent += captionContent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace document.getElementById('filteredBy')
with filteredByCaption
, as you've defined it as a variable above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
if (element.multiple === true) { | ||
const selectedOptions = element.querySelectorAll('option:checked'); | ||
const selectedTextValues = Array.from(selectedOptions).map((el) => el.text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use Array.from(...)
as it's not support in IE11. Use [].slice.call(selectedOptions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we supporting ie11 or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the JS, yes apparently
Thanks! |
Right I guess I need to do all the other components now |
Completes the work from joomla#28997 Testing is the same
[4.0] Filtered Item Information work continued from #28997
Table of Contacts, Sorted by: Title - descending, Filtered by: Status - Published
[4.0] Filtered Item Information work continued from joomla#28997
In a previous pull request I added code which adds a caption to every table AND indicates how the table is sorted. This is only visible to screen readers. This is very important for accessibility so a user will now all the relevant information for the table being displayed
To improve this further it should also include how the table is filtered.
I have only enabled this for the table of contacts at this time. If/when approved I will do the same for the other tables.
This PR will also allow the designers to add a visual display of the filters which people like @angieradtke have suggested
I also had to use real label strings for the filters instead of re-using the string from the option. I should have done this before but ...
Thanks to @wilsonge for fixing the js
(as this is javascript it will require either
npm i
ornode build.js --compile-js
to test it)Testing is really simple
Once the pr has been applied and the js compiled go to the list of all contacts in the admin
If you view source you will see
Play around adding filters and it will change as below
A screen reader will see the text as
Table of Contacts, Sorted by: Title - descending, Filtered by: Status: Published