Skip to content
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

[Switch] Display processing status #19140

Closed
nuragic opened this issue Jan 9, 2020 · 7 comments
Closed

[Switch] Display processing status #19140

nuragic opened this issue Jan 9, 2020 · 7 comments
Labels
component: switch This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@nuragic
Copy link
Contributor

nuragic commented Jan 9, 2020

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…

@oliviertassinari oliviertassinari added the out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future) label Jan 9, 2020
@oliviertassinari
Copy link
Member

Thanks for the proposal.

@nuragic
Copy link
Contributor Author

nuragic commented Jan 9, 2020

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

@oliviertassinari oliviertassinari added component: switch This is the name of the generic UI component, not the React module! low priority and removed out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future) labels Jan 9, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 9, 2020

@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 [Button] Add loading support #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.

@oliviertassinari oliviertassinari added waiting for 👍 Waiting for upvotes and removed low priority labels Jan 9, 2020
@oliviertassinari oliviertassinari added the new feature New feature or request label Jan 9, 2020
@nuragic
Copy link
Contributor Author

nuragic commented Jan 9, 2020

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 👍

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 9, 2020

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?".

@sergiolenza
Copy link

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

@nuragic
Copy link
Contributor Author

nuragic commented Jan 29, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: switch This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

3 participants