Skip to content

Commit d549881

Browse files
Scroll with the moving item
The item is moved with the keyboard and the item stays in view of the user.
1 parent b146347 commit d549881

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dd-draggable.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
238238
e.target.dispatchEvent(new MouseEvent('mouseup'))
239239

240240
this.keyboardSelected = this._selectedItem(this.keyboardSelected)
241+
this.keyboardSelected.scrollIntoView({ block: "center" })
242+
241243
const handle: HTMLElement = this.keyboardSelected.querySelector('.grid-item-handle')
242244

243245
handle?.dispatchEvent(new MouseEvent('mousedown'))

0 commit comments

Comments
 (0)