-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[material-ui][Button] Apply id only if loading indicator is present #45296
base: master
Are you sure you want to change the base?
[material-ui][Button] Apply id only if loading indicator is present #45296
Conversation
Netlify deploy previewhttps://deploy-preview-45296--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
const loader = | ||
typeof loading === 'boolean' ? ( | ||
let loader = null; | ||
let computedId = idProp; |
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.
If there's no loading present, we just use the id
prop. loadingId
always has a value (idProp
or generated using useId
)
7c4d446
to
34e25af
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.
This makes sense, but I would like to have @siriwatknp's review next week, as he is more familiarized with potential edge cases.
Should we cherry-pick this to v6?
@DiegoAndai I just added the cherry-pick label |
@aarongarciah the "cherry-pick" one is for PRs that are cherry-picked. I updated the labels 😊. |
We introduced an
id
attribute in all buttons when we introduced theloading
prop in theButton
component (#44637). We've got a couple of reports that some tests were broken because of this: #44637 (comment)This PR changes the logic so the
id
attribute is only added when the loading indicator is present.