kopia lustrzana https://github.com/Tldraw/Tldraw
7442456d85
When a device has both a touch screen and a mouse, pointer: coarse evaluates to false and then doesn't change even if the user begins to use the touch screen. In this PR pointer: coarse is replaced with any-pointer: coarse, which checks if a touchscreen input is available. Event listeners for touchstart and mousemove update isCoursePointer dynamically. So if the user begins to move the mouse it changes to pointer: fine, if they then touch the screen the pointer is returned to coarse. https://github.com/tldraw/tldraw/assets/98838967/fb86bb44-ec11-4161-bb2f-0e8c3ee83eb6 ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [ ] `sdk` — Changes the tldraw SDK - [x] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [x] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Load tldraw on a device with both coarse and fine pointer inputs avaiable (e.g. an ipad with a keyboard and trackpad) 2. Switch between using the mouse and touch screen. 3. Handles on shapes should update dynamically. ### Release Notes - Add a brief release note for your PR here. --------- Co-authored-by: Mime Čuvalo <mimecuvalo@gmail.com> Co-authored-by: Steve Ruiz <steveruizok@gmail.com> |
||
---|---|---|
.. | ||
useCanvasEvents.ts | ||
useCoarsePointer.ts | ||
useContainer.tsx | ||
useCursor.ts | ||
useDarkMode.ts | ||
useDocumentEvents.ts | ||
useEditor.ts | ||
useEditorComponents.tsx | ||
useEvent.tsx | ||
useFixSafariDoubleTapZoomPencilEvents.ts | ||
useFocusEvents.ts | ||
useForceUpdate.ts | ||
useGestureEvents.ts | ||
useHandleEvents.ts | ||
useIdentity.tsx | ||
useIsCropping.ts | ||
useIsDarkMode.ts | ||
useIsEditing.ts | ||
useLocalStore.ts | ||
usePeerIds.ts | ||
usePresence.ts | ||
useSafariFocusOutFix.ts | ||
useSafeId.ts | ||
useScreenBounds.ts | ||
useSelectionEvents.ts | ||
useTLStore.ts | ||
useTransform.ts | ||
useZoomCss.ts |