(evt, fallback)
| 96 | }, |
| 97 | |
| 98 | _handleAutoScroll(evt, fallback) { |
| 99 | const x = (evt.touches ? evt.touches[0] : evt).clientX, |
| 100 | y = (evt.touches ? evt.touches[0] : evt).clientY, |
| 101 | |
| 102 | elem = document.elementFromPoint(x, y); |
| 103 | |
| 104 | touchEvt = evt; |
| 105 | |
| 106 | // IE does not seem to have native autoscroll, |
| 107 | // Edge's autoscroll seems too conditional, |
| 108 | // MACOS Safari does not have autoscroll, |
| 109 | // Firefox and Chrome are good |
| 110 | if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) { |
| 111 | autoScroll(evt, this.options, elem, fallback); |
| 112 | |
| 113 | // Listener for pointer element change |
| 114 | let ogElemScroller = getParentAutoScrollElement(elem, true); |
| 115 | if ( |
| 116 | scrolling && |
| 117 | ( |
| 118 | !pointerElemChangedInterval || |
| 119 | x !== lastAutoScrollX || |
| 120 | y !== lastAutoScrollY |
| 121 | ) |
| 122 | ) { |
| 123 | pointerElemChangedInterval && clearPointerElemChangedInterval(); |
| 124 | // Detect for pointer elem change, emulating native DnD behaviour |
| 125 | pointerElemChangedInterval = setInterval(() => { |
| 126 | let newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true); |
| 127 | if (newElem !== ogElemScroller) { |
| 128 | ogElemScroller = newElem; |
| 129 | clearAutoScrolls(); |
| 130 | } |
| 131 | autoScroll(evt, this.options, newElem, fallback); |
| 132 | }, 10); |
| 133 | lastAutoScrollX = x; |
| 134 | lastAutoScrollY = y; |
| 135 | } |
| 136 | } else { |
| 137 | // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll |
| 138 | if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) { |
| 139 | clearAutoScrolls(); |
| 140 | return; |
| 141 | } |
| 142 | autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false); |
| 143 | } |
| 144 | } |
| 145 | }; |
| 146 | |
| 147 | return Object.assign(AutoScroll, { |
nothing calls this directly
no test coverage detected
searching dependent graphs…