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

Slider: add support for crossing multiple handles #1892

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hsyl20
Copy link

@hsyl20 hsyl20 commented Aug 1, 2019

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

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.
@hsyl20
Copy link
Author

hsyl20 commented Aug 1, 2019

I need some help with the test: I can't simulate a handle drag event (commented code in the test). it dies with:

>> slider: options - allowCrossingHandles
>> Message: Died on test #2 file:///home/hsyl20/repo/jquery-ui/tests/unit/slider/options.js:404:11
>> execCb@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:1658:38
>> check@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:874:57
>> enable@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:1151:27
>> init@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:782:32
>> callGetModule@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:1178:67
>> completeLoad@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:1552:34
>> onScriptLoad@file:///home/hsyl20/repo/jquery-ui/external/requirejs/require.js:1679:41: Attempting to change access mechanism for an unconfigurable property.
>> Actual: null
>> Expected: undefined
>> defineProperty@[native code]
>> mouseEvent@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:122:26
>> createEvent@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:83:26
>> simulateEvent@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:73:31
>> simulateDrag@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:307:21
>> simulate@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:30:17
>> file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:19:17
>> each@file:///home/hsyl20/repo/jquery-ui/external/jquery-1.12.4/jquery.js:370:23
>> each@file:///home/hsyl20/repo/jquery-ui/external/jquery-1.12.4/jquery.js:137:21
>> simulate@file:///home/hsyl20/repo/jquery-ui/external/jquery-simulate/jquery.simulate.js:18:18
>> file:///home/hsyl20/repo/jquery-ui/tests/unit/slider/options.js:418:26

Copy link

@crskbel-ca crskbel-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@crskbel-ca crskbel-ca left a 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,

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" );

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,

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 } );

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 ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base automatically changed from master to main February 19, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants