-
Notifications
You must be signed in to change notification settings - Fork 840
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
[EuiButtonIcon] Add isLoading
prop
#5668
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_5668/ |
1 similar comment
Preview documentation changes for this PR: https://eui.elastic.co/pr_5668/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5668/ |
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 looks great to me - I have one very minor Typescript suggestion, but that's it. I QA'd in the playground and it looked like it was working perfectly 👍
@@ -173,6 +180,15 @@ export const EuiButtonIcon: FunctionComponent<Props> = ({ | |||
); | |||
} | |||
|
|||
// `original` size doesn't exist in `EuiLoadingSpinner` | |||
// when the `iconSize` is `original` we don't pass any size to the `EuiLoadingSpinner` | |||
// so it gets the default size |
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.
Super appreciate this comment for context!
Preview documentation changes for this PR: https://eui.elastic.co/pr_5668/ |
Thanks @constancecchen 🎉
I fixed it. 👍🏽 |
Summary
This PR adds an
isLoading
prop to EuiButtonIcon and closes #5649. It follows the other buttons' patterns, when theisLoading
istrue
the button gets disabled, and the icon is replaced with a EuiLoadingSpinner.The EuiButtonIcon can have different icon sizes. So the icon size also dictates the size of the EuiLoadingSpinner. For this reason and to match all the EuiButtonIcon sizes a new size was introduced to the EuiLoadingSpinner:
"XXL"
.There is one exception. If consumers pass
"original"
toiconSize
the EuiLoadingSpinner will get its default size"m"
.Checklist
[ ] Checked in mobile[ ] Added documentation[ ] Checked Code Sandbox works for any docs examples[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes