#3982 closed defect (fixed)
Slider: doesn't always respect discreteValues with showButtons="true"
Reported by: | guest | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Dijit - Form | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
HOW TO REPRODUCE:
Go to <http://82.230.65.68:31416/~fred/dojo/fred_samples/bug_001.html> Press '+' on first slider Press '+' on second slider
RESULT:
First slider Value = 0.024793388429752067 Second slider Value = 0.01
EXPECTED RESULT:
First slider Value = 0.01 Second slider Value = 0.01
Attachments (1)
Change History (9)
Changed 14 years ago by
Attachment: | bug_001.html added |
---|
comment:2 Changed 14 years ago by
phiggins on irc said:
phiggins in /dijit/form/Slider.js phiggins var count = this.discreteValues; if(count > maxPixels){ count = maxPixels; } count--; phiggins var pixelsPerValue = maxPixels / count; var wholeIncrements = Math.round(pixelValue / pixelsPerValue); phiggins the pixels are off
don't fully know what that means :-)
comment:3 Changed 14 years ago by
Owner: | changed from bill to Douglas Hays |
---|
comment:4 Changed 14 years ago by
Milestone: | → 1.0 |
---|
Hmm, it's a pretty obscure case where a slider has more discrete values than pixels (in this case 301 vs 200), but I suppose you could make + work to just go one value even if it's the same pixel... don't know how much work that is though and whether or not it's worth it. Marking to consider for 1.0.
comment:5 Changed 14 years ago by
I'm the original reporter
If the correct fix is too complex (having subpixels values), there are 2 others possible fixes:
1)Using a multiple of the increment: that way, in a slider having 301 values and only 200 pixels, we would have '+' moving by 2 values. That would be good enough, and should not be too difficult to implement.
2) Even simpler, '+' could be plainly disabled if there is not enough space (or could simply increment the value of '0'), because if a UI designed chose a Slider it is because the "analog" feedback is more important than a precise value entry.
I think the current behavior is very wrong because:
1) Having a Slider that is integer based returning non integral values is a major breach on contract
2) The bug will appear depending on the browser width (so an app with no issue on a Desktop will break on a mobile phone, for instance).
comment:6 Changed 14 years ago by
Summary: | dijit.form.HorizontalSlider don't always respect discreteValues with showButtons="true" → Slider: doesn't always respect discreteValues with showButtons="true" |
---|
comment:7 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Content of mentionned file