-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Slider: add support for crossing multiple handles #1892
base: main
Are you sure you want to change the base?
Conversation
With this patch, a slider which has both "range = true" and "allowCrossingHandles = true" automatically determines the handlers starting and stopping the range. Handlers can freely cross each other.
I need some help with the test: I can't simulate a handle drag event (commented code in the test). it dies with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -22,6 +22,7 @@ common.testWidget( "slider", { | |||
step: 1, | |||
value: 0, | |||
values: null, | |||
allowCrossingHandles: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -401,4 +401,24 @@ QUnit.test( "range", function( assert ) { | |||
element.slider( "destroy" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -22,6 +22,7 @@ common.testWidget( "slider", { | |||
step: 1, | |||
value: 0, | |||
values: null, | |||
allowCrossingHandles: false, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of #
assert.deepEqual( element.slider( "values" ), [ 25, 75 ], "values" ); | ||
|
||
// var handles = element.find( ".ui-slider-handle" ); | ||
// handles.eq( 0 ).simulate( "drag", { dx: 1000 } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1853
Duplicate of #
}, { | ||
queue: false, | ||
duration: o.animate | ||
} ); | ||
} | ||
} else { | ||
if ( i === 0 ) { | ||
if ( i === rangeStartIndex ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this patch, a slider which has both "range = true" and "allowCrossingHandles = true" automatically determines the handlers starting and stopping the range. Handlers can freely cross each other.
Follow-up of #1869