Tldraw/packages/tldraw
Mime Čuvalo a253af95d9
textfields: on mobile edit->edit, allow going to empty geo (#3469)
(this is a PR redo of https://github.com/tldraw/tldraw/pull/3424 which
got messed up a bit)

It doesn't quite feel like this is the right fix but it does solve the
issue. I was trying to see if `getShapeAtPoint` needed more work but the
further I went in that rabbit hole it seemed like I shouldn't touch that
code without causing a bunch of disruption at the moment.

Specifically, the code that does `Check labels first` in Editor.ts is a
little obscure (lines 4384-4397). It only checks a couple specifics
shapes (with certain combinations, i.e. a geo with "none" fill) _and_ it
doesn't check `hitLabels` which also maybe feels wrong? I tried
unraveling it but there's a lot of code relying on it at the moment to
mess with it in the stickies work.
(I was looking at https://github.com/tldraw/tldraw/pull/1910 and
https://github.com/tldraw/tldraw/pull/1806 for historical context fwiw)

Before:


https://github.com/tldraw/tldraw/assets/469604/b263a192-2085-4ffb-9e47-6e9c32abe1f9



After:


https://github.com/tldraw/tldraw/assets/469604/5b0b422b-dd5c-4593-9ac5-dec595923ea6



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `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 ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `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
2024-04-17 09:34:23 +00:00
..
api New migrations again (#3220) 2024-04-15 12:53:42 +00:00
scripts
src textfields: on mobile edit->edit, allow going to empty geo (#3469) 2024-04-17 09:34:23 +00:00
CHANGELOG.md
LICENSE.md
README.md
api-extractor.json
api-report.md New migrations again (#3220) 2024-04-15 12:53:42 +00:00
package.json New migrations again (#3220) 2024-04-15 12:53:42 +00:00
setupTests.js
tsconfig.json New migrations again (#3220) 2024-04-15 12:53:42 +00:00

README.md

tldraw

tldraw

This package contains the source code for the tldraw library. Learn more at our docs site: tldraw.dev.

Installation

Install the tldraw package.

npm i tldraw

Then start the local development server.

npm run dev

Usage

import { Tldraw } from 'tldraw'
import 'tldraw/tldraw.css'

export default function () {
	return <Tldraw />
}

Visit or docs site to learn more. See our examples folder for more examples.

Community

Have questions, comments or feedback? Join our discord or start a discussion.

Distributions

You can find tldraw on npm here.

Contribution

Please see our contributing guide. Found a bug? Please submit an issue.

License

The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use.

If you wish to use this project in commercial product, you need to purchase a commercial license. Please contact us at sales@tldraw.com for more inforion about obtaining a commercial license.

Trademarks

Copyright (c) 2024-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.

Contact

Find us on Twitter at @tldraw or email sales@tldraw.com. You can also join our discord for quick help and support.