kutlugsahin / smooth-dnd

drag and drop library for javascript
MIT License
615 stars 148 forks source link

Scrolling within vertical containers #54

Open richrout opened 5 years ago

richrout commented 5 years ago

Hello!

I have a trello-ish "task" system, and when I try to add "overflow-y: auto" on my "lane" to make it scroll independently (aka not with the whole page) - this breaks the functionality when you drag an individual card across the screen. It will not scroll the whole page if the card is over a lane towards the edge of the screen. Moving it out of the lane will scroll the page like normal.

Can provide more information/reproduction if it is needed. But any ideas if there is a work around for this? Or if this should work?

richrout commented 5 years ago

This is reproducible if you just add the following styles to the .smooth-dnd-container on the demo page.

    max-height: 400px;
    overflow-y: auto;

image

Try dragging a card towards the left/right side where it should start scrolling, instead it does nothing.

image

HoaDevDn commented 4 years ago

yep i got the same issue =(( Can't scroll if we set max-height for the column could you hot fix? @johanneswilm @richrout @klaasman @kutlugsahin

gregoryforel commented 4 years ago

Hello @johanneswilm , @richrout , @klaasman @kutlugsahin ! A gentle bump, in case any of you has some time to look into this issue. Many thanks in advance in any case, and thanks for the library!

richrout commented 4 years ago

I have a pull request that I tested and works for the "Trello scenario"

No one has looked at the PR though: #55

gregoryforel commented 4 years ago

Thanks @richrout ! 3 questions if I may:

richrout commented 4 years ago

For sure.

gregoryforel commented 4 years ago

No need to demo. Thank you so much! It works like a charm. Maybe you can bump the guys ref your PR again? So many people have the same issue.