-
Notifications
You must be signed in to change notification settings - Fork 1k
Tag - add aria label for prop to remove button #7571
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
Conversation
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
src/js/components/Tag/__tests__/__snapshots__/Tag-test.tsx.snap
Outdated
Show resolved
Hide resolved
src/js/components/Data/__tests__/__snapshots__/Data-test.tsx.snap
Outdated
Show resolved
Hide resolved
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 Brittany. Looks like it needs some types updates.
src/js/components/Tag/index.d.ts
Outdated
@@ -5,6 +5,9 @@ export interface TagProps { | |||
name?: string; | |||
onClick?: (...args: any[]) => any; | |||
onRemove?: (...args: any[]) => any; | |||
messages?: { | |||
removeLabel?: string; |
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 needs to be updated for the new keys
src/js/components/Tag/propTypes.js
Outdated
@@ -7,6 +7,9 @@ if (process.env.NODE_ENV !== 'production') { | |||
value: PropTypes.string.isRequired, | |||
onClick: PropTypes.func, | |||
onRemove: PropTypes.func, | |||
messages: PropTypes.shape({ | |||
removeLabel: PropTypes.string, |
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.
same
…aria-label-tag
…mmet into add-aria-label-tag
glad I added the tests. I saw that
since |
Fair enough although I think that's a silly requirement and people tend to pick one or the other based on whether or not they want it to be bold. |
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!
Holding off on merging until after the upcoming patch release |
Updated with master but looks like we need to bump the bundlesize up |
…aria-label-tag
…mmet into add-aria-label-tag
What does this PR do?
adds a prop for
aria-label
to be passed inWhere should the reviewer start?
tag.js
What testing has been done on this PR?
locally
How should this be manually tested?
locally
Do Jest tests follow these best practices?
I didnt add one since it got added to other snapshots
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
On the Tag component there is no way for the implementer to provide an aria-label
What are the relevant issues?
closes #7555
Screenshots (if appropriate)
Do the grommet docs need to be updated?
yes
Should this PR be mentioned in the release notes?
yes
Is this change backwards compatible or is it a breaking change?
backwards compatible