fix: keep auto-scroller enabled during keyboard drag to prevent item escaping scrollable container - #2124
Open
waterWang wants to merge 1 commit into
Open
fix: keep auto-scroller enabled during keyboard drag to prevent item escaping scrollable container#2124waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…escaping scrollable container KeyboardSensor previously disabled the AutoScroller plugin during keyboard drag via its sideEffects() method. This meant that when a user held down an arrow key to move a draggable item, the auto-scroller was disabled and the item could be moved entirely outside the scrollable container element. The fix removes the sideEffects() call and the sideEffects() method entirely, keeping the AutoScroller enabled during keyboard drag so the scrollable container scrolls naturally as the item approaches its edges. The Scroller plugin already handles per-keyboard-event scrolling via its dragmove event listener, and the AutoScroller's interval-based continuous scrolling fills the gap when the user holds down an arrow key, preventing the item from scrolling beyond the container bounds. Fixes clauderic#2119
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2119
When keyboard-dragging an item inside a scrollable container, holding down the arrow key could move the item entirely outside the container because the
AutoScrollerplugin was disabled during keyboard drag.Root Cause
The
KeyboardSensor.sideEffects()method disabled theAutoScrollerplugin when a keyboard drag started. Without the auto-scroller, the scrollable container would not scroll as the item approached its edges, allowing the user to move the item beyond the container bounds.Fix
Removed the
sideEffects()call fromhandleStart()and thesideEffects()method entirely. TheAutoScrollerandScrollerplugins now remain enabled during keyboard drag, allowing the container to scroll naturally as the keyboard-dragged item approaches its edges.Scrollerplugin already handles per-keyboard-event scrolling via itsdragmoveevent listener (line 104-118 in Scroller.ts)AutoScrollerplugin provides continuous interval-based scrolling that fills the gap when the user holds down an arrow keyTest Plan