-
Notifications
You must be signed in to change notification settings - Fork 233
fix(button-base): make aria label change on update after first update lifecycle #5619
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
fix(button-base): make aria label change on update after first update lifecycle #5619
Conversation
|
if (changed.has('label')) { | ||
if (this.label) { | ||
this.setAttribute('aria-label', this.label); | ||
} else { | ||
this.removeAttribute('aria-label'); | ||
} | ||
} |
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 for doing this. Its a miss edge case from our side. But for better code maintainability can you extract this logic into a private method to avoid duplication. There are three instances of the same code. Second can you please add a test to verify aria-label
changes when the label
property changes after initial render.
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.
LGTM!
Once we extract the logic in a function and add a changeset for this, I believe we are good to mege!
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 to me
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.
@tsavka-adobe Theres a few things that need to be addressed with this PR before we can get it merged in.
- We will need you to sign the CLA
- There are failing tests that need to be resolved
- Automated tests need to be added to cover this new functionality
- Manual testing steps need to be added to the PR descriptions particularly since this is a11y based
please close this PR. I think there is another PR for this issue. |
Description
Currently the aria-label attribute gets set on firstUpdate. This causes an issue when the button is rendered and then the prop is updated. The change is not getting reflected. This makes sure the change actually gets reflected.
GitHub bug:
Motivation and context
Adobe Expres bug
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch
,minor
, ormajor
featuresManual review test cases
Descriptive Test Statement
Descriptive Test Statement
Device review