mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: prevent selection when resizing in Safari
This commit is contained in:
parent
c493509579
commit
29c9314c6d
1 changed files with 3 additions and 1 deletions
|
|
@ -75,7 +75,9 @@ export function useResizeHandler(
|
|||
return () => window.removeEventListener('pointerup', onPointerUp)
|
||||
}, [])
|
||||
|
||||
const onPointerDown = React.useCallback(({ clientX, clientY }: React.PointerEvent) => {
|
||||
const onPointerDown = React.useCallback((e: React.PointerEvent) => {
|
||||
e.preventDefault() // Prevent unexpected selection when dragging in Safari
|
||||
const { clientX, clientY } = e
|
||||
pointerDown.current = true
|
||||
initialSizeRef.current = [clientX, clientY]
|
||||
baseSize.current = latestPropSize.current
|
||||
|
|
|
|||
Loading…
Reference in a new issue