Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

can't drag over list or overflow #14

Closed
rohitdaryanani opened this issue Jul 21, 2015 · 16 comments
Closed

can't drag over list or overflow #14

rohitdaryanani opened this issue Jul 21, 2015 · 16 comments

Comments

@rohitdaryanani
Copy link

Hey I cant seem to drag items if the list is long. the list won't scroll down .

Thanks

@luckylooke
Copy link
Owner

please provide live demo, jsfiddle,jsbin,webpage whatever, then I can see the setup, thanks

@rohitdaryanani
Copy link
Author

Here's the link .Sorry about that. It’s basically a stripped down version of the example you provided. I just added additional items, set the max height and had an overflow y so it would be scrollable. There are 13 items on the list but initially, it displays only items 1 to 6. I would like to drag item number 1 or 2 to be placed after item number 7 but i can’t seem to scroll when i reach item number 6. Hope this helps, Thanks

repolink

Gif Demo

gif demo

@luckylooke
Copy link
Owner

Thanks, now I can precisely imagine what is the problem, I will be thinking about solution.

@luckylooke
Copy link
Owner

Interesting is that when I try to scroll while dragging in our demo page, it works fine. I must find out what blocks scrolling in your case.

EDIT: Now I know why is it so.. It is because browser is not aware of the fact that sursor is over scrollable area, because it is still over dragging ghost. The ghost is part of a whole page, that is why scroll is working globally. I need to find solution now.

@luckylooke
Copy link
Owner

I think I have found solution.. but I will implement it later as it needs to change dragular code for it a bit.

ghostElm.onwheel = function(e){    
containerElm.scrollTop += e.deltaY;
};

@luckylooke
Copy link
Owner

If you need it now, it solved already in dev branch 'v150'

@rohitdaryanani
Copy link
Author

Hey thanks a lot for this. Works great

@luckylooke
Copy link
Owner

But I havent test it on touch device. So if anyone could.. please test it,
thanks ;-)
On Jul 24, 2015 1:58 AM, "Rohit Daryanani" notifications@github.com wrote:

Hey thanks a lot for this. Works great


Reply to this email directly or view it on GitHub
#14 (comment).

@rohitdaryanani
Copy link
Author

Works great on desktop, has issues on ipad it doesn't drag properly will try to post a gif or something.

@luckylooke
Copy link
Owner

I thought so, I will need to make some workaround for touch devices.

@jameswyse
Copy link
Collaborator

For old browsers you should also listen to the mousewheel and DOMMouseScroll events.
For touch devices you could try playing with the touchmove, touchend, scroll and gesturechange events.

It can be tricky because of the momentum scrolling in iOS etc. calling preventDefault in the touchmove handler usually helps get immediate feedback, but also prevents the actual scroll

@zeeamber
Copy link

scrolling drag is working great with chrome but why its not working with firefox ?
@luckylooke @rohitdaryanani

@luckylooke
Copy link
Owner

@zeeamber If you have time, you can play with those events and try to make it work.. thanks

@luckylooke luckylooke modified the milestones: 1.5.0, 2.1.0 Aug 7, 2015
@luckylooke
Copy link
Owner

Should be OK by v2.1.0

@manuelfink
Copy link

Just looking for the same solution.
Is this yet part of ng2-dragula?
Can you add docs on how to use/configure this with ng2-dragula?

@luckylooke
Copy link
Owner

I am not watching ng2-dragula but i saw that recently dragula it selves accepted PR related to scrolling, so it is very likely that it will be working in ng2-dragula out of the box after updating dragula dependency.

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

No branches or pull requests

5 participants