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

[Slider] Update to match the specification #20153

Closed
mukhammad-akilov opened this issue Mar 17, 2020 · 4 comments · Fixed by #26632
Closed

[Slider] Update to match the specification #20153

mukhammad-akilov opened this issue Mar 17, 2020 · 4 comments · Fixed by #26632
Labels
component: slider This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Milestone

Comments

@mukhammad-akilov
Copy link

mukhammad-akilov commented Mar 17, 2020

I need to change text in label, not background color

image

const theme = createMuiTheme({ overrides:{ MuiSlider: { valueLabel: { color: 'black', }, } }

  • [x ] The issue is present in the latest release.
  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

It changes only tbackground color, not text color

Expected Behavior 🤔

It should change only text color, not background color

Tech Version
Material-UI v4.9.0
React 16.12.0
Browser Google Chrome 80
@mukhammad-akilov
Copy link
Author

mukhammad-akilov commented Mar 17, 2020

I fixed this problem by changing constrastText to "needed color" pallete theme

@oliviertassinari oliviertassinari added component: slider This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process labels Mar 19, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 19, 2020

@Ghost180195 Thanks for raising this issue. At first glance, it seems that we will need to update the style of the component:

Capture d’écran 2020-03-19 à 01 55 46

https://material.io/components/sliders/#anatomy

Capture d’écran 2020-03-19 à 01 55 56

https://www.google.com/flights


We should be able to move from 3 to 1 or 2 elements. In any case, it's likely a breaking change, so something to plan for v5.

In the meantime, I would propose that we make the SliderValueLabel a public component:

diff --git a/packages/material-ui/src/Slider/ValueLabel.js b/packages/material-ui/src/Slider/ValueLabel.js
index e2f21ec0d..6b57749d5 100644
--- a/packages/material-ui/src/Slider/ValueLabel.js
+++ b/packages/material-ui/src/Slider/ValueLabel.js
@@ -69,4 +69,4 @@ function ValueLabel(props) {
   );
 }

-export default withStyles(styles, { name: 'PrivateValueLabel' })(ValueLabel);
+export default withStyles(styles, { name: 'MuiSliderValueLabel' })(ValueLabel);

@Ghost180195 Do you want to work on the problem? :)

@oliviertassinari oliviertassinari changed the title Question / Bug. How to change React Material UI slider label text [Slider] Update to match the specification Mar 19, 2020
@oliviertassinari oliviertassinari added this to the v5 milestone Mar 19, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 29, 2020

The latest design of the slider I could find on Google's product:

Capture d’écran 2020-09-30 à 01 38 37

Capture d’écran 2020-09-30 à 01 40 51

  • Google Pixel 4 (2019) Android 11 (Latest version)

Capture d’écran 2020-09-30 à 01 46 39

Any other idea where we could find a slider to benchmark?

@oliviertassinari
Copy link
Member

More sources to benchmark:

  • Adobe XD kit released in August 2020:

Capture d’écran 2020-10-03 à 23 47 11

Capture d’écran 2020-10-03 à 23 51 19

Capture d’écran 2020-10-04 à 00 10 11

@oliviertassinari oliviertassinari added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Mar 17, 2021
@oliviertassinari oliviertassinari modified the milestones: v5-beta, v5 May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
2 participants