{"action":"created","issue":{"url":"https://api.github.com/repos/material-components/material-components-web/issues/1426","repository_url":"https://api.github.com/repos/material-components/material-components-web","labels_url":"https://api.github.com/repos/material-components/material-components-web/issues/1426/labels{/name}","comments_url":"https://api.github.com/repos/material-components/material-components-web/issues/1426/comments","events_url":"https://api.github.com/repos/material-components/material-components-web/issues/1426/events","html_url":"https://github.com/material-components/material-components-web/issues/1426","id":265722720,"number":1426,"title":"discrete mdc-slider doesn't allow step values < 1","user":{"login":"gjdev","id":533888,"avatar_url":"https://avatars2.githubusercontent.com/u/533888?v=4","gravatar_id":"","url":"https://api.github.com/users/gjdev","html_url":"https://github.com/gjdev","followers_url":"https://api.github.com/users/gjdev/followers","following_url":"https://api.github.com/users/gjdev/following{/other_user}","gists_url":"https://api.github.com/users/gjdev/gists{/gist_id}","starred_url":"https://api.github.com/users/gjdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gjdev/subscriptions","organizations_url":"https://api.github.com/users/gjdev/orgs","repos_url":"https://api.github.com/users/gjdev/repos","events_url":"https://api.github.com/users/gjdev/events{/privacy}","received_events_url":"https://api.github.com/users/gjdev/received_events","type":"User","site_admin":false},"labels":[{"id":494904464,"url":"https://api.github.com/repos/material-components/material-components-web/labels/bug","name":"bug","color":"ee0701","default":true},{"id":495093973,"url":"https://api.github.com/repos/material-components/material-components-web/labels/in-tracker","name":"in-tracker","color":"CE5C17","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-10-16T10:35:38Z","updated_at":"2017-10-29T08:47:11Z","closed_at":null,"author_association":"NONE","body":"### What MDC-Web Version are you using?\r\n\r\n0.22.0\r\n\r\n### What browser(s) is this bug affecting?\r\n\r\nAll\r\n\r\n### What OS are you using?\r\n\r\nAll\r\n\r\n### What are the steps to reproduce the bug?\r\n\r\n1. Create and initialize a discrete slider\r\n2. Set step value to e.g. 0.5\r\n3. The resulting step value will be 1, not 0.5\r\n\r\n### What is the expected behavior?\r\n\r\nA step value of 0.5\r\n\r\n### What is the actual behavior?\r\n\r\nA step value of 1\r\n\r\n### Any other information you believe would be useful?\r\n\r\nhttps://github.com/material-components/material-components-web/blob/b77895b82850872ba2acdac94f8807c09adc50f3/packages/mdc-slider/foundation.js#L218\r\n\r\nExplicitly sets the value to 1, when it is < 1.\r\n\r\nThis is in contradiction with the documentation (README) which says: \"The step value can be any positive floating-point number\", and \"Discrete sliders are required to have a positive step value other than 0\".\r\n"},"comment":{"url":"https://api.github.com/repos/material-components/material-components-web/issues/comments/340246365","html_url":"https://github.com/material-components/material-components-web/issues/1426#issuecomment-340246365","issue_url":"https://api.github.com/repos/material-components/material-components-web/issues/1426","id":340246365,"user":{"login":"danielweck","id":625201,"avatar_url":"https://avatars3.githubusercontent.com/u/625201?v=4","gravatar_id":"","url":"https://api.github.com/users/danielweck","html_url":"https://github.com/danielweck","followers_url":"https://api.github.com/users/danielweck/followers","following_url":"https://api.github.com/users/danielweck/following{/other_user}","gists_url":"https://api.github.com/users/danielweck/gists{/gist_id}","starred_url":"https://api.github.com/users/danielweck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielweck/subscriptions","organizations_url":"https://api.github.com/users/danielweck/orgs","repos_url":"https://api.github.com/users/danielweck/repos","events_url":"https://api.github.com/users/danielweck/events{/privacy}","received_events_url":"https://api.github.com/users/danielweck/received_events","type":"User","site_admin":false},"created_at":"2017-10-29T08:47:11Z","updated_at":"2017-10-29T08:47:11Z","author_association":"NONE","body":"In the interim, I worked around this problem by using % percentage values, so for example instead of range `min=1`, `max=2` with `step=0.25`, I use `min=100`, `max=200` with `step=25` which is suboptimal because the discrete popup values displayed to my users (or even the screen reader accessible ARIA labels) do not match the expected possible slider values, in terms of UX.\r\n\r\nThe culprit seems to be `|| step < 1` in:\r\nhttps://github.com/material-components/material-components-web/blob/8f98c7e24e6f9131aac2e461cdef934500e3ae74/packages/mdc-slider/foundation.js#L218"}}
{"actor":{"display_login":"danielweck"}}