-
Notifications
You must be signed in to change notification settings - Fork 616
Let aria-required be undefined if not passed #4058
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
Changes from all commits
4ba2a63
db213b8
f51589f
5888cfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
TextInput, Textarea: Does not pass `aria-required` attribute to input or textarea if it is undefined. This fixes some tests that were breaking in dotcom. | ||
|
||
<!-- Changed components: TextInput, Textarea --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,7 +144,7 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>( | |
onFocus={handleInputFocus} | ||
onBlur={handleInputBlur} | ||
type={type} | ||
aria-required={required ? 'true' : 'false'} | ||
aria-required={required} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a quick question do we want to have Or do we only want to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes :) I asked Mike to create this PR because I found some snapshot tests in dotcom that compare the dom, so any additional props, even when false fail integration tests 🤦 |
||
{...inputProps} | ||
data-component="input" | ||
/> | ||
|
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.
We still use
aria-required={required ? 'true' : 'false'}
on Radio and Checkbox. Should we update those as well? Or are we worried this could also break tests in dotcom?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.
What are the broken 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.
There are some tests in dotcom that compare the dom, so any additional props even when false fail CI 🤦
Ideally they should not depend on attributes from within primer components, but it's common :(
Uh oh!
There was an error while loading. Please reload this page.
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.
Only one way to find out, going to run the integration tests for this PR
Update: Seems like there are no new errors 🎉 https://github.com/github/github/actions/runs/7208501227/job/19637623263