From 4569e7d7e9d968b0f041ed3a2868acc4c1b7b18e Mon Sep 17 00:00:00 2001 From: Alexander Melnik <47505999+melnikkk@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:50:05 +0100 Subject: [PATCH] Provided an ability to select multiple arrow labels using ctrl/cmd key (#5161) This PR solves the issue #5065. It makes it possible to select multiple arrow descriptions using the cmd key, which was impossible before. https://github.com/user-attachments/assets/193ee887-1011-481d-b2d3-16dfa753c0fc ### Change type - [x] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other` ### Release notes - Provided an ability to select multiple arrow labels using ctrl/cmd key --- .../tools/SelectTool/childStates/PointingArrowLabel.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts index e61b7329d011..d2c1e2583ed2 100644 --- a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts +++ b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts @@ -57,6 +57,15 @@ export class PointingArrowLabel extends StateNode { this._labelDragOffset = Vec.Sub(labelGeometry.center, pointInShapeSpace) this.markId = this.editor.markHistoryStoppingPoint('label-drag start') + + const additiveSelectionKey = info.shiftKey || info.accelKey + if (additiveSelectionKey) { + const selectedShapeIds = this.editor.getSelectedShapeIds() + this.editor.setSelectedShapes([...selectedShapeIds, this.shapeId]) + + return + } + this.editor.setSelectedShapes([this.shapeId]) }