Skip to content

Commit ac62fd5

Browse files
committed
Fix leaking drag handler event
1 parent 708f098 commit ac62fd5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PageLayout/PageLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & Draggable
314314
return () => {
315315
window.removeEventListener('mousemove', handleDrag)
316316
window.removeEventListener('mouseup', handleDragEnd)
317+
window.removeEventListener('keydown', handleKeyDrag)
318+
window.removeEventListener('keyup', handleKeyDragEnd)
317319
document.body.removeAttribute('data-page-layout-dragging')
318320
}
319321
}, [isDragging, isKeyboardDrag, currentWidth, minWidth, maxWidth])

0 commit comments

Comments
 (0)