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

Fix: when dragging the slider, the mouse movements get attached to the s... #261

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mirovit
Copy link

@mirovit mirovit commented Sep 12, 2014

When the nanoScroller is created dynamicly within a select2 instance, there is an issue - when you start dragging the slider with the mouse, after releasing it (if it is not at the top or bottom) the mouse movement gets translated as scroll.

To fix it I added an event listener for mouseleave.

Sorry for the first one, I am new new to git and didn't see that I changed the other files. Now I have included only the .coffee file that can be compiled to js.

…e scroll

Fix: when dragging the slider, the mouse movements get attached to the
scroll

Adding `mouseleave` event handler that calls events.up() seems to clear
the problem
@kristerkari
Copy link
Collaborator

Thanks! I still need to test this.

@kristerkari
Copy link
Collaborator

Sorry about this taking too long, gonna try to test it during the weekend.

@kristerkari
Copy link
Collaborator

@mirovit I tested your PR code. I tried to reproduce the problem that you are trying to solve in this PR, but did not manage to do it. Is this something that is specific to using Select2? Could you provide me info on how to reproduce the problem or put together a demo of it?

I'll be happy to merge your patch as soon as I can understand the problem.

@mirovit
Copy link
Author

mirovit commented Oct 11, 2014

@kristerkari I have used it here - http://www.jobtiger.bg/obiavi-za-rabota/?ln=1

But I have applied the fix in the JS, and this is the reason I made the pull request - to be able to upgrade the plugin version, without having to manually add that line of code to the source.

If you want to reproduce it, the easiest way is to get a CDN version of the JS and replace the one in the site with the CDN version through the Dev Tools.

@kristerkari
Copy link
Collaborator

@mirovit Alright, thanks. So do you think that this is possible to happen in nanoScroller, or is it related to having Select2 + nanoScroller on the same page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants