Skip to main content

Search and Top Navigation

#9376 closed bug (fixed)

Opened June 13, 2013 01:18PM UTC

Closed October 08, 2014 01:07PM UTC

Last modified January 10, 2015 01:56PM UTC

Slider value can be set greater than value of 'max' option

Reported by: Bacher Owned by:
Priority: minor Milestone: 1.11.2
Component: ui.slider Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Slider value can be set greater than value of 'max' option

Example on jsfiddle:

http://jsfiddle.net/Bacher/6sdHc/

In this case, I can set value 100.

Attachments (0)
Change History (12)

Changed June 13, 2013 01:42PM UTC by tj.vantoll comment:1

Behavior still occurs on 1.10.3: http://jsfiddle.net/tj_vantoll/TYm77/.

I have mixed feelings about this, technically what is being passed in is invalid because the attributes don't line up.

min
is
1
,
max
is
99
, and
step
is
3
. If you change the
min
or
max
to correctly be multiples of 3 (the
step
value), this works fine.

That being said *maybe* we should support this because I could see it being a bit confusing.

Changed June 18, 2013 05:15AM UTC by dekajp comment:2

Please have a look at this fix. I added a Slider.html in tests/Visual and modified jquery.ui.slider.js

I am sorry i missed the commit message style {WHAT} .

https://github.com/dekajp/jquery-ui/commit/f6efec156ca716e543b377572737ee990a09ce28

https://github.com/dekajp/jquery-ui/commit/2e05f3bcda3019a8483e298d67c41812475aa3f1

Changed June 18, 2013 07:06AM UTC by Bacher comment:3

Good Fix. Thank you.

Changed June 18, 2013 01:12PM UTC by tj.vantoll comment:4

Replying to [comment:2 dekajp]:

Please have a look at this fix. I added a Slider.html in tests/Visual and modified jquery.ui.slider.js I am sorry i missed the commit message style {WHAT} . https://github.com/dekajp/jquery-ui/commit/f6efec156ca716e543b377572737ee990a09ce28 https://github.com/dekajp/jquery-ui/commit/2e05f3bcda3019a8483e298d67c41812475aa3f1

Hi @dekajp,

If you are interested in contributing a change please submit it as a pull request. Also we no longer maintain the visual tests and we'll want a unit test for this change.

Thanks.

Changed June 18, 2013 01:57PM UTC by dekajp comment:5

@tj Sure , i will update my code and submit a pull request. Thank you for quick feedback !!!

Changed June 19, 2013 01:27PM UTC by dekajp comment:6

@tj , I have submitted a pull request. https://github.com/jquery/jquery-ui/pull/1009

Looks like my commit history on my master is not very clean . I do not know if - this is a problem ? Let me know if you want me to rebase and clean my commit history. I am very new to Github :(

Changed July 16, 2013 09:24PM UTC by petersendidit comment:7

New pull request that should resolve this problem: https://github.com/jquery/jquery-ui/pull/1030

Changed October 07, 2014 11:22AM UTC by jzaefferer comment:8

status: newopen

Changed October 08, 2014 01:07PM UTC by Jyoti Deka comment:9

resolution: → fixed
status: openclosed

Slider: Don't allow a slider's value to exceed its max

Fixes #9376

Closes gh-1016

Changeset: 6833a3169775d4c15dd5e68c96bc63ad0187035e

Changed October 08, 2014 01:08PM UTC by tj.vantoll comment:10

milestone: none1.11.2

Changed January 10, 2015 01:46PM UTC by edimov comment:11

This fix has caused another issue though. Concerning slider with (float) step value. Example, slider with min=1, max=10, step=1 works great, however slider with min=1, max=2.5, step=0.01 never reaches 2.5 value.

Fiddle:

http://jsfiddle.net/edimov/ku7mL577/14/

Quite nasty, as there is no consistency to incorporate some universal logic to fix with a workaround.

Changed January 10, 2015 01:56PM UTC by scottgonzalez comment:12

That's being tracked in #10721.