From c39e4377938b72f2375651b607e6fa240891d0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mime=20=C4=8Cuvalo?= Date: Tue, 16 Apr 2024 11:58:12 +0100 Subject: [PATCH] stickies: dont remove selection ranges when edit->edit (#3484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was necessary before but with latest refactors it doesn't help anything. Also, it causes a minor issue with document title: https://linear.app/tldraw/issue/TLD-2398/double-clicking-board-title-when-editing-text-doesnt-auto-select-the ### Change Type - [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 - [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 --- .../src/lib/tools/SelectTool/childStates/EditingShape.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/tldraw/src/lib/tools/SelectTool/childStates/EditingShape.ts b/packages/tldraw/src/lib/tools/SelectTool/childStates/EditingShape.ts index 27eae5cab..759cd480a 100644 --- a/packages/tldraw/src/lib/tools/SelectTool/childStates/EditingShape.ts +++ b/packages/tldraw/src/lib/tools/SelectTool/childStates/EditingShape.ts @@ -100,10 +100,6 @@ export class EditingShape extends StateNode { this.editor.mark('editing on pointer up') this.editor.select(selectingShape.id) - - // When clicking on a different shape's label, we need to clear the other selection - // proactively until the pointer up happens. - requestAnimationFrame(() => window.getSelection()?.removeAllRanges()) return } }