-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add explanation of asterisk for required fields to example forms and documentation #820
base: main
Are you sure you want to change the base?
Conversation
🟢 No design token changes found |
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.
Copilot reviewed 1 out of 2 changed files in this pull request and generated no suggestions.
Files not reviewed (1)
- apps/docs/content/components/FormControl.mdx: Language not supported
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
|
@@ -328,6 +328,8 @@ Pass the `fullWidth` prop to `FormControl` to provide additional behavior and st | |||
|
|||
Pass the `required` prop to `FormControl` to provide additional behavior and state context to all `children`, rather than the input only. | |||
|
|||
When marking a field as required, it is recommended to also provide a corresponding message at the start of the form informing the user that "_all fields marked with an asterisk (\*) are required_". |
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.
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.
Ah good spot, thanks.
I'd searched for all <form>
tags but looks like that was missing one. I've wrapped it in one now and made the required change 👍
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.
Thanks @joshfarrant.
@simmonsjenna here's a sample of the required field statement we need Site to add to all form designs going forward. Let us know if you have any further guidance on spacing, positioning or colors. We can fix in a follow up.
e5cd4c2
to
127844e
Compare
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.
Copilot reviewed 8 out of 10 changed files in this pull request and generated no suggestions.
Files not reviewed (2)
- apps/docs/content/components/FormControl.mdx: Language not supported
- packages/react/src/forms/TextInput/TextInput.module.css: Language not supported
Tip: Turn on automatic Copilot reviews for this repository to get quick feedback on every pull request. Learn more
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.
Any idea what's going on with these? Presumably it's the avatar being switched to a local fixture?
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.
Yea I'm not sure, that's all I can imagine but I don't understand why that would trigger an update 🤔
...pshots/Visual-Comparison-FormControl-FormControl-w-Error-Validation---Playground-1-linux.png
Outdated
Show resolved
Hide resolved
} | ||
|
||
const isInvalid = /\s/g.test(value) |
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.
FYI we've lost the animation here, presumably because we're not forcing a re-render? Out of interest, was this intentional or just a side-effect of cleaning this example up?
Previous (current) production with animation:
Screen.Recording.2024-11-21.at.11.03.17.mov
Now with this regex approach:
Screen.Recording.2024-11-21.at.11.03.39.mov
…ation message" This reverts commit 3bbd80c. This fix will be added in its own PR.
Summary
Supporting resources (related issues, external links, etc):
Contributor checklist:
update snapshots
label to the PR)Reviewer checklist: