@@ -364,21 +364,24 @@ const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & Draggable
364364 window . addEventListener ( 'keydown' , handleKeyDrag )
365365 window . addEventListener ( 'mouseup' , handleDragEnd )
366366 window . addEventListener ( 'keyup' , handleKeyDragEnd )
367- document . body . setAttribute ( 'data-page-layout-dragging' , 'true' )
367+ const body = document . body as HTMLElement | undefined
368+ body ?. setAttribute ( 'data-page-layout-dragging' , 'true' )
368369 } else {
369370 window . removeEventListener ( 'mousemove' , handleDrag )
370371 window . removeEventListener ( 'mouseup' , handleDragEnd )
371372 window . removeEventListener ( 'keydown' , handleKeyDrag )
372373 window . removeEventListener ( 'keyup' , handleKeyDragEnd )
373- document . body . removeAttribute ( 'data-page-layout-dragging' )
374+ const body = document . body as HTMLElement | undefined
375+ body ?. removeAttribute ( 'data-page-layout-dragging' )
374376 }
375377
376378 return ( ) => {
377379 window . removeEventListener ( 'mousemove' , handleDrag )
378380 window . removeEventListener ( 'mouseup' , handleDragEnd )
379381 window . removeEventListener ( 'keydown' , handleKeyDrag )
380382 window . removeEventListener ( 'keyup' , handleKeyDragEnd )
381- document . body . removeAttribute ( 'data-page-layout-dragging' )
383+ const body = document . body as HTMLElement | undefined
384+ body ?. removeAttribute ( 'data-page-layout-dragging' )
382385 }
383386 } , [ isDragging , isKeyboardDrag , currentWidth , minWidth , maxWidth ] )
384387
0 commit comments