bug(drag-drop): Auto-scroll step is double the expected value due to RxJS bug #19242
Labels
area: cdk/drag-drop
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
The auto-scroll pixel step size per frame is currently set as 2.
But this is false. The actual scroll step is double this value (4).
ng-run demo
The above demo has a
console.log
statement added here:Notice the typical value being reported is +4 or -4 while auto-scrolling.
GIF of auto-scroll and resulting console log:
Problem
The
interval(0, animationFrameScheduler)
call below triggers an RxJS bug that causes the work in the subscription to be called twice as often.More information on this bug can be found in this issue report, and a fix is supposedly in for the next RxJS patch. Even so, it is not recommended to use
animationFrameScheduler
to run loops. The newanimationFrames
observable is for this purpose, but that's an RxJS 7.0 feature.I think a regular
requestAnimationFrame
loop should be used instead.Environment
The text was updated successfully, but these errors were encountered: