Voiceover announcement and programmatic association to field#54
Open
maria-gourevitch wants to merge 6 commits intoractoon:masterfrom
Open
Voiceover announcement and programmatic association to field#54maria-gourevitch wants to merge 6 commits intoractoon:masterfrom
maria-gourevitch wants to merge 6 commits intoractoon:masterfrom
Conversation
maria-gourevitch
commented
Sep 1, 2023
- Add role=text on the actual number of words. This reduces the changes of Voiceover (especially on MacOS) garbling the announcement.
- Programmatically associate the counter with the text field. This will allow screen reader users to hear this information when they focus in the field (either right away or by asking for more details, depending on their screen reader settings). This is to support WCAG success criterion 1.3.1 Info & Relationships, using advisory technique ARIA1
This should prevent VoiceOver announcing just "remaining" (VoiceOver has a well-known issue where it does not announce the entire element when there are inline tags). There should be no effect on other screen readers.
…is a conflict with the auto-generated ID). Use it to programmatically associate counter with textarea.
…avoid random-sounding announcements on ajax submissions (observed in Drupal 9).
…s helps avoid random-sounding announcements on ajax submissions (observed in Drupal 9)." This reverts commit d1f8844.
ractoon
requested changes
Sep 16, 2023
Owner
ractoon
left a comment
There was a problem hiding this comment.
This is great! Just had a couple small comments, but this would be very helpful to merge into the project.
| minDisplayCutoff : -1, // maximum number of characters/words above the minimum to display a count | ||
| maxDisplayCutoff : -1, // maximum number of characters/words below the maximum to display a count | ||
|
|
||
| counterId' : null, // custom ID for the counter element (e.g. to prevent conflicts). If one is not provided, a default ID will be assigned based on the ID of the element. |
Owner
There was a problem hiding this comment.
Suggested change
| counterId' : null, // custom ID for the counter element (e.g. to prevent conflicts). If one is not provided, a default ID will be assigned based on the ID of the element. | |
| counterId : null, // custom ID for the counter element (e.g. to prevent conflicts). If one is not provided, a default ID will be assigned based on the ID of the element. |
| base.init = function() { | ||
| base.options = $.extend({}, $.textcounter.defaultOptions, options); | ||
|
|
||
| var counterElementId = base.options.counterId ?? base.el.id + '_counter'; |
Owner
There was a problem hiding this comment.
My only concern with setting it this way is if there are multiple instances on a page, with an empty ID, then this would create duplicate IDs. Perhaps something like jQuery UIs uniqueId function behavior could be duplicated here instead: https://github.com/jquery/jquery-ui/blob/1be45388176080418aef84f3c98fda2c10fcdc42/ui/unique-id.js#L43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.