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

Can not auto scroll with nested components #1373

Closed
mgnjatovic-kushim opened this issue Oct 15, 2018 · 12 comments
Closed

Can not auto scroll with nested components #1373

mgnjatovic-kushim opened this issue Oct 15, 2018 · 12 comments
Assignees
Labels
enhancement Quality of life changes to existing features

Comments

@mgnjatovic-kushim
Copy link

From : SortableJS/Vue.Draggable#355 (comment)

Jsfiddle link

https://jsfiddle.net/6pk7zxLq/18/

Step by step scenario

If i have a draggable group, in which i can drag elements on same list with self scroll and between more lists with outer scroll, auto scrolling only works on inner lists

Expected Solution

Enable auto scroll on both lists or provide an option to choose which element will scroll horizontally and which element will scroll vertically

@nlaveck
Copy link

nlaveck commented Oct 15, 2018

I think this is more a problem with having nested scrollable containers than sortable. In your example, I'm able to auto scroll the outer list by dragging an element from the inner list into the area with the blue background. However the outer-list will not auto scroll if I'm dragging over an inner list because the inner list is trying to scroll.

@mgnjatovic-kushim
Copy link
Author

Maybe I'm missing something. Is there a way to achieve that behavior without having nested containers?

@nlaveck
Copy link

nlaveck commented Oct 15, 2018

It really depends on the page layout. I think it'd be less of a problem if your inner scrollable containers are smaller and in the center of the page. Or don't make the inner containers scrollable and allow them to grow.

@mgnjatovic-kushim
Copy link
Author

mgnjatovic-kushim commented Oct 15, 2018

Yeah, thanks for your suggestions, but my layout is not a subject to change, and there is even less space around.

@owen-m1
Copy link
Member

owen-m1 commented Nov 8, 2018

It works fine for me...

@owen-m1
Copy link
Member

owen-m1 commented Nov 8, 2018

Never mind, I see your issue. You want it to autoscroll on the X axis even if the element is above another list?

@owen-m1 owen-m1 added the enhancement Quality of life changes to existing features label Nov 8, 2018
@owen-m1 owen-m1 self-assigned this Nov 9, 2018
@owen-m1
Copy link
Member

owen-m1 commented Nov 13, 2018

@mgnjatovic-kushim Please let me know if PR #1386 solves this issue. There is a demo included in the description.

@mgnjatovic-kushim
Copy link
Author

Unfortunately no. Try to move a card from first column to last. Behavior I was hoping for is something like trello.

@owen-m1
Copy link
Member

owen-m1 commented Nov 13, 2018

@mgnjatovic-kushim Try setting the option forceFallback:true. HTML native DnD has it's own autoscroll method that doesn't work the same as the implemented autoscroll.

@owen-m1
Copy link
Member

owen-m1 commented Nov 16, 2018

@mgnjatovic-kushim Have you tried this?

@mgnjatovic-kushim
Copy link
Author

I've resolved issue by adding div around whole component, and implementing the scroll when card is dragged manually. That's the only thing that worked. Force fallback was set to true whole time, not making any difference.

@owen-m1
Copy link
Member

owen-m1 commented Nov 16, 2018

@mgnjatovic-kushim I apologize, there was a part of that code I forgot to delete. The fixed working demo should be available here: https://jsbin.com/kesewor/edit?html,js,output

You can also use this link in your original JSFiddle as Sortable.JS to use the updated autoscroll: https://rawcdn.githack.com/RubaXa/Sortable/cd01d01fce598e1be99d40771ce3f16860dde1d7/Sortable.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Quality of life changes to existing features
Projects
None yet
Development

No branches or pull requests

3 participants