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

[mwc-slider] UI doesn't work properly for step < 1 #1028

Closed
Daymannovaes opened this issue Mar 23, 2020 · 8 comments · Fixed by #2567
Closed

[mwc-slider] UI doesn't work properly for step < 1 #1028

Daymannovaes opened this issue Mar 23, 2020 · 8 comments · Fixed by #2567
Assignees
Labels
Type: Bug Something isn't working

Comments

@Daymannovaes
Copy link

Describe the bug
I'm building a slider that goes from -1 to 1, with steps sized 0.01. But the UI doesn't work properly, and the values only are able to be set as -1, 0 and 1.

To Reproduce
Steps to reproduce the behavior:

the HTML goes like this:

<mwc-slider
    min="-1"
    max="1"
    step="0.01"
></mwc-slider>

Expected behavior
The values should range from -1 to 1 continuously, instead of only discrete values (-1 0 1).

Screenshots
Screen-Recording-2020-03-23-at-1 45 01-PM_1

Browser Version (please complete the following information):

  • OS: Mac OS
  • Browser Chrome
  • Version 80.0.3987.132
@Daymannovaes Daymannovaes added the Type: Bug Something isn't working label Mar 23, 2020
@asyncLiz
Copy link
Collaborator

Unfortunately this is a known issue reported in material-components/material-components-web#1426. I'll add it to our backlog to track.

@MarcSkovMadsen
Copy link

I need this solved as well. I need to wrap it into a MWC FloatSlider that takes discrete value, min, max and step.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>MWC Slider</title>
    <script src="https://unpkg.com/@material/mwc-slider@0.18.0?module" type="module"></script>
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">
    </head>
  <body>
    <mwc-slider style="width:100%" value="5.2" min="4.2" max="5.6" step="0.1"></mwc-slider>
  </body>

</html>

@mahdiridho
Copy link

Looks like I have similar issue, this is my code :

<mwc-slider step=0.0001 min="0.01225" max="0.0125" value="0.01225"></mwc-slider>

I can't drag the slider thumb, it stuck on the left side
Screenshot from 2020-08-12 14-54-11

@mahdiridho
Copy link

Hello.. Is this issue on the radar? Looks no response yet longer time.

@MarcSkovMadsen
Copy link

The slider does not support float steps. You will need to work around this by normalizing your min, max and step values.

@mahdiridho
Copy link

What do you mean does not support float steps? Sounds like no plan to support this bug? I was using paper-slider on my previous polymer projects and no problem with float steps. Since migrating all to litelement, I decided to replace all webcomponents with mwc UI including mwc-slider.

Due to this issue, I'm using my own slider component written in litelement for a while. I thought mwc team will support and fix this bug.

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Sep 11, 2020

I’m a user of mwc. Not a developer.

I just mean that it does not Work and it’s not like mwc ships bug fixes and new features often i believe.

I’ve starting looking for other web component frameworks with more momentum like Fast for this reason.

@mahdiridho
Copy link

Well, I'm trying adjust the mwc-slider by creating extended class here :

https://github.com/mahdiridho/mwc-slider-extended

So, I can work with floating points now. I'm not sure it's good solution or no, at least it works for me

@e111077 e111077 self-assigned this Jul 23, 2021
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 23, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 24, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
copybara-service bot pushed a commit that referenced this issue Jul 26, 2021
Upcoming work:

* implement theme
* add component tests

fixes #1885
fixes #2109
fixes #2108
fixes #523
fixes #1028
fixes #1671
fixes #1279

PiperOrigin-RevId: 367260030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants