Skip to content
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

Text Area Character Count Component #1691

Open
JamesR-CA opened this issue Dec 8, 2021 · 5 comments
Open

Text Area Character Count Component #1691

JamesR-CA opened this issue Dec 8, 2021 · 5 comments
Assignees
Labels
proposed small enhancement An enhancement where the component or pattern architecture otherwise remains stable

Comments

@JamesR-CA
Copy link
Collaborator

Text Area Character Count Component

Please provide a summary of the changes you would like to make to the existing component, along with any reasoning and supporting information.

To add a Character Count numbering to the TextArea (https://citizensadvice.github.io/design-system/?path=/story/forms-textarea--basic) to support:

• integration with other platforms (such as Casebook) when data transfer and receiving fields require limits added to map correctly across systems
• encourage users to provide sufficient information (on the principle that we would want to transmit the minimum amount of information)
• provide users understanding how many characters are allowed to be added to certain form fields using the TextArea component
• this would be a variant to the existing Text Area - so not all TextAreas would require a character count

Follow-up questions:
• what is the accessibility requirement for non-js and best practice guidance?
• Do we follow the GDS model (https://design-system.service.gov.uk/components/character-count/)?

Depending on the above follow-up questions:
• designs will need to be generated to support development

@JamesR-CA JamesR-CA added the small enhancement An enhancement where the component or pattern architecture otherwise remains stable label Dec 8, 2021
@mrdaniellewis
Copy link

We have one in Casebook, designed by Shakira. It follows the gov.uk design principles, but the difference is the count is at the top rather than the bottom. That might be because our error message is at the bottom.

We also have an older one in Casebook where the count was on the top right, but I think that used maxlength.

Screenshot 2021-12-08 at 13 24 42

@davidrapson
Copy link
Contributor

The key thing to take from the GDS example would be making sure that the component is within an appropriate aria-live region and that is clearly describes the units (is it a character count or a word count). If there's an existing production example in Casebook that's great!

@mrdaniellewis
Copy link

It doesn't have the aria-live attribute. It does have the aria-describedby.

Hmmm, easy to add but I'd want to test that carefully. Some screen-readers queue all the aria-live messages which would create a message for every change of character count instead of just the last change. Also some screen-readers will read out a change in aria-describedby like it is a live region leading to duplicated messages, which the page does note is a problem in JAWS.

@davidrapson
Copy link
Contributor

davidrapson commented Dec 8, 2021

Yeah definitely one we'd want to test carefully! When I've had to implement this in the past I've also seen aria-live=polite + aria-atomic=true work reasonably well but very dependent on the context and how different tools interpret things. Definitely not ideal for it to just announce "500!" really aggressively at folks.

@mrdaniellewis
Copy link

Yes 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposed small enhancement An enhancement where the component or pattern architecture otherwise remains stable
Development

No branches or pull requests

4 participants