Material-ui: [Switch] Display processing status

Created on 9 Jan 2020  ·  7Comments  ·  Source: mui-org/material-ui

Source: https://material.io/components/selection-controls/selection-controls.html#switches

material-ui switch processing

I know, there're cases on where the "optimistic UI" approach would save you from having to show a progress indicator, but there're some cases where this is so much needed!

Please, consider adding this feature. I'd love to have a loading or processing prop perhaps…

Switch enhancement waiting for 👍

Most helpful comment

Hi guys.
For anyone interested in this particular case I made this codesandbox:

https://codesandbox.io/s/switch-loading-state-vpinv

As @nuragic said, thanks to how the API has been built, we can use composition to achieve it.

I can put it as a demo in the switch demo page if you wish @oliviertassinari

All 7 comments

Thanks for the proposal.

Hey @oliviertassinari,

I think it would be good to know why you're closing without any explanation.

If it's just "we don't have time/resources to do this" or also "but we're open for PRs" maybe?

Thanks

@nuragic, I have added the "upvotes" label to the issue, so we don't lose track of this proposal in the future. A few notes:

  • I think that solving #7223 is more important.
  • Is this a frequent pattern? For instance, is this pattern used in one of the products of Google or Apple, etc?
  • Opening a pull request is half the time needed, the other half it the attention of the maintainers and the follow-up issues.

Thanks for clarifying! I agree that loading state on buttons is far more common, but it's also easier to solve it in userland with composition perhaps? I guess everyone do so... in the case of switch, well, it's not possible AFAICT.

About the question if this pattern is used in one of the products of Google or Apple, etc? I don't know, why this matters to you?

Regarding the time needed from maintainers: I know, reviewing and merging a PR is just the beginning... Many thanks to all of you who spend so much effort on material-ui! 💌

Fair, let's see if someone will show their 👍

About the question if this pattern is used in one of the products of Google or Apple, etc? I don't know, why this matters to you?

This is probably the most important aspect for us, it helps to answer the value part of the equation that makes us invest time on different topics (value/cost): "What's the amplitude of the pain point?".

Hi guys.
For anyone interested in this particular case I made this codesandbox:

https://codesandbox.io/s/switch-loading-state-vpinv

As @nuragic said, thanks to how the API has been built, we can use composition to achieve it.

I can put it as a demo in the switch demo page if you wish @oliviertassinari

Thanks! I think it would be great to add this example in the docs, yup!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pola88 picture pola88  ·  3Comments

ghost picture ghost  ·  3Comments

finaiized picture finaiized  ·  3Comments

FranBran picture FranBran  ·  3Comments

mb-copart picture mb-copart  ·  3Comments