react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

A suggestion to have a loading state on the button

Open ogustavo-pereira opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. When we use the button component and this button has a loading linked to it, we always have to create conditionals on top of the icon and even the disabled one. I think that as an abstraction of the material-ui, the react-admin button component could provide a difference, such as manipulating a loading prop, where I call a boolean and it automatically modifies the icon and changes it to disabled.

Describe the solution you'd like Today, to get around this point, we created a component that abstracts this loading logic but that could easily be handled within the button component.

https://marmelab.com/react-admin/Buttons.html#button

Additional context Today the button component is very simplistic, which is actually positive, however wouldn't it be better to have a loading property?

ogustavo-pereira avatar Dec 12 '23 13:12 ogustavo-pereira

Thank you for your suggestion. Let's wait for feedback from the community to see if this is something that other people would want too :slightly_smiling_face:

slax57 avatar Dec 12 '23 14:12 slax57

I thin we should rely on MUI for that. Material-ui has a Loading Button, but it's in their lab...

https://mui.com/material-ui/react-button/#loading-button

I suggest you ask MUI to move their LoadingButton to stable so we can consider using it. But they seem to be waiting for their v6 for that.

fzaninotto avatar Dec 13 '23 16:12 fzaninotto

No news for some time, closing.

fzaninotto avatar May 13 '24 11:05 fzaninotto