-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[LoadingButton] Loading component should be inline when positioned left or right #37959
Comments
@chriswilty Thanks for reporting this ~ I kind of expected setting The current behavior is also not in line with the Material Design 2 spec: |
I'm working on it |
Hi are you still working on it? I'm interested in taking over if it is possible :) |
go ahead |
@ivanhouttaylor thanks, good observation, at least now we now a workaround for this. I saw #28652 where it was fixed, but apparently hardcoded for just Also fixable with happening on v5.15.19. |
Duplicates
Latest version
Summary 💡
Currently, the loading spinner/component is position:absolute for all positions. If I have a button stretching the full length of its container, as opposed to exactly fitting its content, this means with position "start" or "end" the spinner appears at the very beginning or end of the button, with the text label in the middle, which doesn't look good.
It would be far neater (and consistent) if for these two positions, the spinner was simply inlined in the same way as the button's startIcon / endIcon.
Note that the button icon is currently faded out when transitioning to loading state, so this may need a rethink, unless the loading spinner is faded in to match.
Examples 🌈
How it looks when not loading:
How it looks when loading:
How I want it to look:
https://m3.material.io/components/buttons/guidelines#9ecffdb3-ef29-47e7-8d5d-f78b404fcafe
https://m3.material.io/components/buttons/guidelines#89ba49e3-31b5-47ae-9665-3e7f33452d0f
Motivation 🔦
We could remove a fair bit of boilerplate code by using LoadingButton instead of Button. But currently, we cannot use LoadingButton because of this issue, and centrally positioning the loading component is not an option for us because the button text then disappears.
The text was updated successfully, but these errors were encountered: