Commit d010b3c
authored
Fix drag event jitter in Component.pointerDragged by using current coordinates (#4333)
Fixed #3500
The existing logic in Component.pointerDragged scheduled a callSerially runnable to ensure drag events continue (e.g. for auto-scrolling) even if the pointer is stationary. However, it captured the `x` and `y` arguments from the method call. If multiple drag events occurred rapidly, these scheduled tasks would execute out of order relative to the latest system events, calling pointerDragged with stale coordinates. This caused the drag position to "jump back" to a previous location, resulting in visual jitter and incorrect drag direction detection.
This fix updates the runnable to use `oldx` and `oldy` (instance fields tracking the latest processed drag position) instead of the captured arguments. This ensures that when the delayed task executes, it uses the most up-to-date position, effectively preventing the replay of stale coordinates.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 6ff2213 commit d010b3c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5083 | 5083 | | |
5084 | 5084 | | |
5085 | 5085 | | |
5086 | | - | |
| 5086 | + | |
5087 | 5087 | | |
5088 | 5088 | | |
5089 | 5089 | | |
| |||
0 commit comments