diff --git a/packages/tldraw/src/lib/ui/TldrawUi.tsx b/packages/tldraw/src/lib/ui/TldrawUi.tsx index ab90149b1..d8e6ba7dd 100644 --- a/packages/tldraw/src/lib/ui/TldrawUi.tsx +++ b/packages/tldraw/src/lib/ui/TldrawUi.tsx @@ -1,5 +1,5 @@ import { ToastProvider } from '@radix-ui/react-toast' -import { preventDefault, useEditor, useValue } from '@tldraw/editor' +import { useEditor, useValue } from '@tldraw/editor' import classNames from 'classnames' import React, { ReactNode } from 'react' import { TldrawUiContextProvider, TldrawUiContextProviderProps } from './TldrawUiContextProvider' @@ -135,7 +135,6 @@ const TldrawUiContent = React.memo(function TldrawUI({ className={classNames('tlui-layout', { 'tlui-layout__mobile': breakpoint < 5, })} - onPointerDown={preventDefault} > {isFocusMode ? (
diff --git a/packages/tldraw/src/lib/ui/components/PageMenu/PageMenu.tsx b/packages/tldraw/src/lib/ui/components/PageMenu/PageMenu.tsx index 43e021603..0b721426c 100644 --- a/packages/tldraw/src/lib/ui/components/PageMenu/PageMenu.tsx +++ b/packages/tldraw/src/lib/ui/components/PageMenu/PageMenu.tsx @@ -108,7 +108,7 @@ export const PageMenu = function PageMenu() { } } }) - }, [ITEM_HEIGHT, currentPage, isOpen]) + }, [ITEM_HEIGHT, currentPage.id, isOpen]) const handlePointerDown = useCallback( (e: React.PointerEvent) => { @@ -336,8 +336,6 @@ export const PageMenu = function PageMenu() { ) : (
diff --git a/packages/tldraw/src/lib/ui/components/primitives/Input.tsx b/packages/tldraw/src/lib/ui/components/primitives/Input.tsx index d2deb8673..9cc45f5d0 100644 --- a/packages/tldraw/src/lib/ui/components/primitives/Input.tsx +++ b/packages/tldraw/src/lib/ui/components/primitives/Input.tsx @@ -1,3 +1,4 @@ +import { useEditor } from '@tldraw/editor' import classNames from 'classnames' import * as React from 'react' import { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey' @@ -54,6 +55,7 @@ export const Input = React.forwardRef(function }, ref ) { + const editor = useEditor() const rInputRef = React.useRef(null) // combine rInputRef and ref @@ -118,6 +120,8 @@ export const Input = React.forwardRef(function ) React.useEffect(() => { + if (!editor.environment.isIos) return + const visualViewport = window.visualViewport if (isFocused && shouldManuallyMaintainScrollPositionWhenFocused && visualViewport) { const onViewportChange = () => { @@ -135,7 +139,7 @@ export const Input = React.forwardRef(function visualViewport.removeEventListener('scroll', onViewportChange) } } - }, [isFocused, shouldManuallyMaintainScrollPositionWhenFocused]) + }, [editor, isFocused, shouldManuallyMaintainScrollPositionWhenFocused]) return (