-
Notifications
You must be signed in to change notification settings - Fork 232
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
Increase amount of text in character count threshold example #2975
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
I'm not sure I understand. What problem are we trying to solve by increasing the amount of text in the example? And does it have to be random text? Could it literally say something about users have an almost unlimited text field to add information to emphasise the point of this section? |
From what I understand the purpose of the 'threshold' feature is to let service teams put in a character count in situations where there's a relatively high character limit in place, but the user is very unlikely to reach it (as it should be relatively short response). This was raised by a user in testing as an accessibility issue for this reason — that:
But... that is the intended use case, and that the vast majority of users shouldn't ned to be aware of it. David's suggestion is to show a more "realistic" example, with a high threshold. As for placeholder text... I'm not sure how we illustrate an overly-long or rambling example in a clear way. Hmm! |
oh ok. so some thoughts - we could change the title of this section, so instead of an instruction it's more of a description of what this option in character count provides. This would be consistent with the other subheads. We could also do a sense check of the content to see if we can explain it more clearly. I think doing something along these lines will answer the accessibility audit concerns by clarifying what this example is showing. The only reason I'm not keen on the gov.uk text is I didn't instinctively understand why it was there. |
Oh, I like that idea. It's a good way to avoid putting in what'd likely be meaningless placeholder text, by using it for a literal purpose (rather than the typical 'hypothetical service' text we usually use ). |
N.B. I used random GOV.UK content for the placeholder as that is what seems to be used in the error message example further down the page. https://design-system.service.gov.uk/components/character-count/#error-messages |
maxlength: 840, | ||
threshold: 80, |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
I know it's a cumbersome ask because it would require more content, but is there any way we can get the threshold to be more like a 75%+ threshold, to be more realistic? I can't think of a use-case where we would want to activate the threshold condition at something as low as 26%.
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.
I added a suggested update tot he content which should bring it to around 849 characters. Then we can go for an 85% threshold on a 100 character limit.
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.
To go with ~850 character textareaValue
value suggested above
maxlength: 840, | |
threshold: 80, | |
maxlength: 1000, | |
threshold: 85, |
Type more letters into this field after this message to see the threshold feature. | ||
|
||
GOV.UK includes services, information and guidance that only government can provide. It’s designed so that users do not need to understand the complex structures of government in order to complete their task. Its content and design is user-centred so that interacting with government is accessible to everybody. | ||
|
||
GOV.UK is the official source of government information. It is impartial so that people trust the content they find. | ||
|
||
Content and services are continually improved to meet user needs. You can visit the GOV.UK roadmap for the most up to date plan for future improvements. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
I'd recommend for screen reader users that we put the most important info at the top, and then add a note that all the text after a certain point is filler text.
Something like this maybe?
Type more letters into this field after this message to see the threshold feature. | |
GOV.UK includes services, information and guidance that only government can provide. It’s designed so that users do not need to understand the complex structures of government in order to complete their task. Its content and design is user-centred so that interacting with government is accessible to everybody. | |
GOV.UK is the official source of government information. It is impartial so that people trust the content they find. | |
Content and services are continually improved to meet user needs. You can visit the GOV.UK roadmap for the most up to date plan for future improvements. | |
This example of a textarea has a character limit of 1000 characters. The character count is hidden, but will appear when there are more than 850 characters entered into this textarea. Type some more text into this textarea to see the character count appear. | |
Beyond this sentence, all text in this text area is filler-text, for demonstration purposes. | |
GOV.UK includes services, information and guidance that only government can provide. It is designed so that users do not need to understand the complex structures of government in order to complete their task. Its content and design is user-centred so that interacting with government is accessible to everybody. | |
GOV.UK is the official source of government information. It is impartial so that people trust the content they find. |
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.
Oh, in that case we could perhaps just repeat the paragraph, will suggest shortly.
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.
Yep that works too! Just something to let screen reader users know that "everything beyond this point is trash" 😛
And then we can add trash!
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.
844 characters, to go with new suggested threshold settings in example:
Type more letters into this field after this message to see the threshold feature. | |
GOV.UK includes services, information and guidance that only government can provide. It’s designed so that users do not need to understand the complex structures of government in order to complete their task. Its content and design is user-centred so that interacting with government is accessible to everybody. | |
GOV.UK is the official source of government information. It is impartial so that people trust the content they find. | |
Content and services are continually improved to meet user needs. You can visit the GOV.UK roadmap for the most up to date plan for future improvements. | |
This example of a textarea has a character limit of 1000 characters. The character count is hidden, but will appear when there are more than 850 characters entered into this textarea. Type some more text into this textarea to see the character count appear. This paragraph is repeated below. | |
This example of a textarea has a character limit of 1000 characters. The character count is hidden, but will appear when there are more than 850 characters entered into this textarea. Type some more text into this textarea to see the character count appear. This paragraph is repeated below. | |
This example of a textarea has a character limit of 1000 characters. The character count is hidden, but will appear when there are more than 850 characters entered into this textarea. Type some more text into this textarea to see the character count appear. |
Hello! I've made 2 suggestions meant to be committed together. I feel fine with the 'job description' text in the Error message bit. |
If the limit is much higher than most users are likely to reach, you can choose to only display the message after a user has entered a certain amount. | ||
#### If the limit is far higher than users are likely to reach | ||
|
||
You can choose to display a character count message only after the user has entered a certain number of characters. This is useful when a character limit is needed, but users are unlikely to reach the limit. |
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.
Technically, it's not about the user entering characters, it's down to a threshold being passed. For example, if the text area is pre-filled, that'll activate the threshold condition as well.
You can choose to display a character count message only after the user has entered a certain number of characters. This is useful when a character limit is needed, but users are unlikely to reach the limit. | |
You can choose to display a character count message only after the length of the text has surpassed a certain 'threshold' number of characters. This is useful when a character limit is needed due to the technical limitations of the service, but users are unlikely to reach the limit. |
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.
This might be a teensy bit misleading now as it implies that the threshold is set based on the number of characters, when it's actually a percentage of the total limit.
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.
How about just removing the word 'number' entirely then?
You can choose to display a character count message only after the length of the text has surpassed a certain 'threshold' of characters. This is useful when a character limit is needed due to the technical limitations of the service, but users are unlikely to reach the limit.
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.
Ahh, this sentence is meant to be a bit of preamble, explaining the experience from the user perspective, before introducing the threshold in the following paragraph.
Do we want to keep working on shaping this sentence, and edit the next paragraph?
Either way we'd need to edit both paragraphs to action on @davidc-gds's original comment as a separate commit:
You can choose to display a character count message if the length of text within the textarea more than a certain 'threshold' of characters. This is useful when a character limit is needed due to the technical limitations of the service, but users are unlikely to reach the limit.
To do this, set the threshold in the component markup as a percentage. For example,
data-threshold="75"
will show the count message only when users have entered 75% of the limit.
Co-authored-by: Calvin Lau <[email protected]>
a5fc120
to
ca5b02e
Compare
@calvin-lau-sig7 @davidc-gds I think I've captured and pushed the most recent content suggestions now. Please give 'em a look through just in case I've missed anything! |
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.
Looks good from my side now! Once the others take a look, should be good to go. 🙌
Thanks @querkmachine, I think we're close! I've added some minor amends, I'm happy to commit with an okay. Otherwise I'll be happy to approve from here. |
Awesome! Great job, everyone! 🚀 🥳 |
Increases the amount of text in the Character Count's 'threshold' example, to better reflect the intended usage being fields with very high character limits that a user is unlikely to encounter naturally.
Suggested by @davidc-gds on alphagov/govuk-frontend#3689.
Thoughts
I'm personally a little dubious as to the efficacy of this change, for a couple of reasons:
text
type having a limit of ≈64,000 characters. This is a limitation a user is unlikely to actually reach in normal use, but one that does technically exist, so only flagging it if the user is approaching it is sensible. This doesn't feel as appropriate for limits of only one or two thousand characters.