-
Notifications
You must be signed in to change notification settings - Fork 4
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
v3 - custom string input with character count #529
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 this didn't take too long, but it'd be nice if we followed Monday Comittments more strictly in terms of not picking tasks outside of our goals.
I also believe there are several other places in the repository with character limit in need of the count.
I agree, but my other tasks were blocked and this was almost finished from last week. |
Should these be added in this PR or left for later? |
I noticed after some digging on slack! We need a better system in terms of alerting others when we're blocked. Especially when we're working on tasks towards out goal for the week. |
I'd do them all in the same PR 👍 |
41c49eb
to
1df64f5
Compare
1df64f5
to
40a0fd0
Compare
@mathiazom maybe convert to draft until you have the time to add char.limit to the remaining places? |
40a0fd0
to
aff6010
Compare
aff6010
to
0d4e537
Compare
0d4e537
to
dd964f4
Compare
78055c1
to
005f8b5
Compare
e2cfad5
to
fb12f3e
Compare
Composes the default string input rendering with a simple character count. Initially only used in SEO fields, but can be later applied where applicable.
fb12f3e
to
996773e
Compare
@@ -0,0 +1,26 @@ | |||
import { Box, Stack, Text } from "@sanity/ui"; |
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.
before we merge can you make sure it passes wcag 2.1? (plenty of studio is just bleh, but we can give it a try since it's a custom component
https://designsystem.digital.gov/components/character-count/accessibility-tests/
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.
Updated now to show the remaining characters, with a red text when over limit. Also added aria-describedby
to announce allowed number of characters. aria-live
has been set on the counter, but I have struggled to get the screen reader to announce it reliably. Seems to be intercepted by text field description, which might be Sanity's fault. Default text input is slightly more reliable based on quick testing.
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.
Yeah, I believe this is on Sanity. Great job though!
Further explanation is found here: #527
Composes the default string input rendering with a simple character count, with required max count. Added to most of the fields with
type: "string"
, but can also be expanded to other fields later.Also renamed all instances of the validation function argument
Rule
torule
(since this is a variable and not a type or class)Visual Overview (Image/Video)
Checklist
Please ensure that you’ve completed the following checkpoints before submitting your pull request:
Additional Notes
Other comments relevant to this pull request.