-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Create drag
event for when a connect is being dragged
#1135
Create drag
event for when a connect is being dragged
#1135
Conversation
- reduce/increase padding on .view-more and .example so it's more even and so the `events order` section can be on one line on desktop views. - Modify demo slider to include a connection between the two handles.
@leongersen What do you think about where the |
Thank you for this PR. I like these changes, and I think this additional event makes sense. Regarding where it is fired: I'd move it into the Regarding the check on whether the element is a connect, I'd like to see this added as a property to The documentation should also mention which |
@leongersen I'll work on that, thanks for the feedback! |
Also add `connect` to EventData
Now it will always return the first handle in the connection, which is important for people who want to access other handles in their drag event callback.
Created drag.js for an example of how to access handles if the event callback.
@leongersen Does that all look good now? |
Yes, looks great! I've just merged this and release noUiSlider 15.1.0. Thanks for contributing! |
There is no event for when a user drags a connect between two starts, this PR creates one named
drag
.It adds these lines:
to the
eventMove()
function. I'm not very familiar with this code base, so I have no idea if this is a good spot to put this (could be a little less performant, since it is checking if the target is a connect on all move events. Don't know how big of an impact this would be though).Currently it just returns the first handle number (
data.handleNumbers[0]
) and to access both values of the starts connected together you'd have to do something like this:I have added this event to the documentation. The demo slider now features a connection between the two handles that were already there and the behaviour is set to 'drag-tap', so that people can test the drag event. I have also modified the padding a little on the
.example
and.view-more
classes so that theevents fire order
list can be on one line for desktop users.Closes #887