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

Once smooth-dnd is touched, can not scroll any more page #83

Open
a-tonchev opened this issue Oct 21, 2020 · 7 comments
Open

Once smooth-dnd is touched, can not scroll any more page #83

a-tonchev opened this issue Oct 21, 2020 · 7 comments

Comments

@a-tonchev
Copy link

I write about this bug in the react-smooth-dnd, but after I check it looks like the bug is from smooth-dnd.

The bug apears on touch devices when you touch or scroll on the smooth-dnd container once, then no more page scrolling is possible.

Bug is reproduced in browser and also in mobile:

  1. Open demo page: https://kutlugsahin.github.io/smooth-dnd-demo/ with mobile chrome / or desktop chrome in Device-mode to simulate touch event

  2. Scroll or somehow touch the smooth-dnd container

-> no more native scrolling possible. You can not scroll top or bottom of the page any more. Page is like blocked.

Expected behavior: scrolling should be possible at any time, maybe only not when dragging item.

If you want guys, I can also upload a video?

Thanks and best regards

@a-tonchev
Copy link
Author

My workaround:

const cleanClasses = () => {
document.body.className = '';
};

document.addEventListener('touchend', cleanClasses, false);

@mathvp
Copy link

mathvp commented Nov 8, 2021

@a-tonchev You just saved me with this workaround! Thank you!

@ulises-jeremias
Copy link

ulises-jeremias commented May 11, 2022

The problem seems to be here.

'touch-action': 'none',

Removing only that class should be less invasive 👌🏻

@CharlieDigital
Copy link

Alternate fix:

// Call from your drop handler.
export function cleanSmoothDnd() {
  document.body.className = document.body.className
    .split(' ')
    .filter(c => c.indexOf('dnd') < 0)
    .join(' ')
}

@Akash187
Copy link

The problem is that normal scrolling is not possible. One can only drag and drop elements only. If you try to scroll to the top or bottom it is not possible.

@CharlieDigital
Copy link

@Akash187 You're right! Simulator seems to be misleading in this case. Back to the drawing board.

@danielwarke
Copy link

Just adding an observation: @a-tonchev's workaround didn't seem to improve the behavior when running chrome on desktop pretending to be a mobile device, but it does fix the issue when I run the code on my actual iPhone.

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

No branches or pull requests

6 participants