Skip to content

Commit 8666b41

Browse files
committed
fix: disable horizontal auto-scroll
#1512 5
1 parent 146fe8f commit 8666b41

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

apps/renderer/src/pages/(main)/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export function Component() {
147147
<AppLayoutGridContainerProvider>
148148
<FeedResponsiveResizerContainer containerRef={containerRef}>
149149
<DndContext
150+
autoScroll={{ threshold: { x: 0, y: 0.2 } }}
150151
sensors={sensors}
151152
collisionDetection={pointerWithin}
152153
onDragEnd={handleDragEnd}

packages/hooks/src/useKeyPressing.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ export function useKeyPressing(key: string) {
55

66
useEffect(() => {
77
const handleKeyDown = (event: KeyboardEvent) => {
8-
setKeysPressed((prev) => new Set(prev).add(event.key))
8+
setKeysPressed((prev) => {
9+
const newSet = new Set(prev)
10+
newSet.add(event.key)
11+
return newSet
12+
})
913
}
1014

1115
const handleKeyUp = (event: KeyboardEvent) => {

0 commit comments

Comments
 (0)