Open alexandrum2k opened 2 years ago
I noticed that it only happens in Firefox. Any way to avoid this unwanted scroll?
I got a temporary solution.
onStart = () => {
if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop
let scrollLeft = window.pageXOffset || document.documentElement.scrollLeft
window.onscroll = () => window.scrollTo(scrollLeft, scrollTop)
}
}
onEnd = () => {
window.onscroll = () => { }
}
Describe the bug Scrolling behaviour sluggish when auto scroll is active and force fallback is true. When scrolling up, the placeholder appears after hovering on each element and that causes the browser to scroll bottom x pixels where x pixels = palceholder height
To Reproduce Steps to reproduce the behavior:
1) Create a sortable instance using settings: scroll: true, forceAutoscrollFallback: true, pull: false, ghostClass: 'block-sort-highlight', dragoverBubble: false, animation: 150, removeCloneOnHide: true, scrollSensitivity: 200, scrollSpeed: 160, bubbleScroll: true
2) create a list of 6 items that can be sorted, with a height of 300px each 3) set placeholder height to 100px (block-sort-highlight) 4) move the first element to the end of the list, using autoscroll feature - it works fine 5) move the last element to the start of the list, using autoscroll feature - everytime the drag item hovers over another item, the placeholder appears and the browser scrolls down 100px (height of placeholder)
Expected behavior Scrolling should delay the placeholder show() until the browser stops scrolling
Information
Versions - Look in your
package.json
for this information: sortablejs = 1.15.0 @types/sortablejs = 1.15.0