tldraw/packages
Taha 7442456d85
Make coarse pointer check dynamic (#3572)
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>
2024-04-27 11:14:23 +00:00
..
assets delete untracked api.json and stale api-report.md files (#3619) 2024-04-25 17:27:28 +00:00
dotcom-shared make route prefixes have a single place where they are defined (#3624) 2024-04-27 10:57:55 +00:00
editor Make coarse pointer check dynamic (#3572) 2024-04-27 11:14:23 +00:00
namespaced-tldraw Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00
state Revert "[signia] Smart dirty checking of active computeds (#3516)" (#3612) 2024-04-25 12:45:36 +00:00
store Automatic undo/redo (#3364) 2024-04-24 18:26:10 +00:00
tldraw stickies: make pit/pack distance the same (#3606) 2024-04-27 11:12:35 +00:00
tlschema Expose migrations, validators, and versions from tlschema (#3613) 2024-04-25 14:31:26 +00:00
tlsync delete untracked api.json and stale api-report.md files (#3619) 2024-04-25 17:27:28 +00:00
utils Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00
validate Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00