Workaround solution for ‘useWindowAsScrollContainer’ not scrolling in ie/chrome/firefox
See original GitHub issueCome across a problem that using ‘useWindowAsScrollContainer’ property, the window won’t scroll when an element dragged to the border of the browser, #58.
It seems that current version v0.6.8 still not fix this problem (maybe it is a feature?).
So, I make a workaround solution:
handleMove(e) {
if (window.innerHeight - event.clientY < 50) {
window.scrollBy(0, 10)} // you can use throttle here
} else if (event.clientY < 50) {
window.scrollBy(0, -10)
}
}
and bind handleMove
to onSortMove
property.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/clauderic/react-sortable-hoc/pull/287
While this indeed scroll the window it has the same effect as moving the wheel mouse while dragging an element. The element “placeholders” are relative to the height while starting dragging and not to the current height of the window. I attached a gif for better demonstration.![scroll window](https://user-images.githubusercontent.com/6170355/31778215-c44edcec-b4f8-11e7-8626-d1507ed5ebae.gif)