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 does not snap to values corresponding to the step attribute (& visually represented by the markers attribute) if set to a non-integer #2109

Closed
lozandier opened this issue Jan 25, 2021 · 2 comments · Fixed by #2567
Assignees
Labels
Type: Bug Something isn't working

Comments

@lozandier
Copy link

Describe the bug
If a non-integer is set to the step attribute of mwc-slider , the slider does not behavior correctly. When interacted with, mwc-slider instances will skip non-integer values to the next integer.

The UI toggable by marker & pin has no problem respecting such values, making this behavior extremely confusing.

This behavior occurs even when the initial minimum value is a non-integer valid within the min & max of an instance.

This behavior is completely deviant from paper-slider; the Material 1 version of this component.

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate or in mark-up define a mwc-slider
  2. Set the step attribute to a non-integer (i.e. 0.5)
  3. Set the markers attribute ; optionally the pin, min & max attributes to more clearly identify the problem (the latter two should have sensible bounds:
<mwc-slider
    pin
    markers
    min="0"
    max="2"
    value="0.5"
    step="0.5">
</mwc-slider>
  1. Interact with the knob of the slider back-n-forth

Expected behavior
That the component can step to all possible values of the slider based on the step & max attributes aligning with how the Material 1 version of this component, paper-slider, behaves.

Screenshots
Video demonstration of problem: https://user-images.githubusercontent.com/1223224/105733034-efe1b380-5ee5-11eb-88b1-70745eeac652.mov

Browser Version (please complete the following information):

  • OS: MacOS Catalina & Big Sur
  • Browser: Chrome
  • Version: 87.0.4280.141+

Additional context
Discussed in detail w/ @dfreedm & @e111077

@lozandier lozandier added Focus Area: Components Type: Bug Something isn't working labels Jan 25, 2021
@e111077 e111077 self-assigned this Jan 25, 2021
@e111077
Copy link
Member

e111077 commented Jan 25, 2021

I am working on the M2 implementation of slider right now, and this is fixed there. Keeping open until that is merged

@christophe-g
Copy link
Contributor

I am working on the M2 implementation of slider right now, and this is fixed there. Keeping open until that is merged

Thanks @e111077, this is good to know. Any tentative ETA ?

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.

3 participants