[Bug]: Touch-scroll momentum aborts on iOS Safari
Link to reproducible scenario
https://www.ag-grid.com/example/
Describe the bug
Steps to reproduce
- Use a grid with enough columns that horizontal scrolling is needed (wider than the viewport).
- On an iOS device and Safari browser, swipe on the grid body with a bit of a diagonal angle so it locks onto horizontal scrolling.
- Keep swiping until you hit the left or right edge of the grid, without lifting your finger.
Actual behavior Scrolling just stops abruptly the instant it hits the edge. You have to lift your finger and start a new swipe to scroll again. Reproduces reliably any time a gesture hits the horizontal boundary mid-touch.
Expected behavior Hitting the scroll boundary should behave like normal iOS smooth scrolling, without killing the rest of the touch gesture.
More information What seems to be happening: iOS's native elastic overscroll briefly reports a scrollLeft past the boundary while your finger is still down, which is just the normal rubber-band physics. onHScroll treats that as out of range against its own computed max/min and immediately snaps it back with _setScrollLeft(), synchronously, on the same element iOS is still actively tracking the touch on. Fighting a native in-progress gesture with a programmatic scroll write on that same element seems to be enough to make WebKit give up on momentum tracking entirely.
For now we're working around it with:
.ag-grid-viewport {
overscroll-behavior-x: none;
}
### Version
36.1.0
### Does the issue occur for a specific framework only?
All languages
### Is the issue only observable on a specific browser?
SafariSource: ag-grid/ag-grid