Allow users to edit the document title by double clicking it even when editing a shape. (#3459)

Fixes [#3437](https://github.com/tldraw/tldraw/issues/3437)

### 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 ️ -->

- [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


### Test Plan

1. Create a shared document
2. Add a text note and start editing it
3. Double click document name. You should be now editing the document
name.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Allow users to editing document name by double clicking even when
previously editing text.
pull/3460/head
Mitja Bezenšek 2024-04-13 21:47:37 +02:00 zatwierdzone przez GitHub
rodzic edf3627229
commit 143755fda0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -304,7 +304,10 @@ const DocumentNameEditor = track(function DocumentNameEditor({
) : (
<div
className="tlui-document-name__text"
onDoubleClick={() => setState((prev) => ({ ...prev, isEditing: true }))}
onDoubleClick={() => {
editor.setEditingShape(null)
setState((prev) => ({ ...prev, isEditing: true }))
}}
>
{addRealSpaceForWhitespace(name)}
</div>