Skip to content

[pull] main from tldraw:main#550

Merged
pull[bot] merged 1 commit into
code:mainfrom
tldraw:main
May 19, 2026
Merged

[pull] main from tldraw:main#550
pull[bot] merged 1 commit into
code:mainfrom
tldraw:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 19, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Adds a new `selectLockedShapes` option to `TldrawOptions` that, when
enabled, lets users select locked shapes with a left click (and via
brush or scribble selection). The editor's existing lock guards still
prevent moving, resizing, editing, or deleting locked shapes, so the
option enables inspection without unlocking.

When `selectLockedShapes: true`:
- `getHitShapeOnCanvasPointerDown` passes `hitLocked: true`
- `Idle.onPointerDown` no longer routes left clicks on locked shapes to
`pointing_canvas`
- `Brushing` and `ScribbleBrushing` include locked shapes
- Hover detection (`updateHoveredShapeId`) treats locked shapes as
hoverable
- `selectOnCanvasPointerUp` allows locked shapes through

When `selectLockedShapes` is `false` (default), behavior is unchanged.

Closes #8548

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [x] `feature`
- [ ] `api`
- [ ] `other`

### Test plan

1. Set `<Tldraw options={{ selectLockedShapes: true }} />` in an example
app.
2. Create a shape, lock it, and click it — it should become selected and
show selection bounds.
3. Try to drag or resize it — nothing should move (lock still applies).
4. Brush over the locked shape with the select tool — it should be
included in the brush selection.
5. Alt-drag (scribble select) over the locked shape — it should also be
included.
6. With the option set to `false` (default), confirm left-clicking a
locked shape still falls through to the canvas, matching the previous
behavior.

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

 ### API changes

- Add a new `selectLockedShapes` option to `TldrawOptions` (and to
`defaultTldrawOptions`). When `false` (default), left-clicking a locked
shape is treated as a click on the canvas; only right-click selects it.
When `true`, locked shapes can be selected via left-click and included
in brush and scribble selections, but the editor's lock guards still
prevent moving, resizing, editing, or deleting them.


### Release notes

- Added a `selectLockedShapes` option to `TldrawOptions`. When enabled,
locked shapes can be selected with left click and brush/scribble
selection while remaining protected from edits, moves, and deletes.

---------

Co-authored-by: angrycaptain19 <53473467+angrycaptain19@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 19, 2026
@pull pull Bot added the ⤵️ pull label May 19, 2026
@pull pull Bot merged commit 1ed9660 into code:main May 19, 2026
@pull pull Bot had a problem deploying to bemo-canary May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to vsce publish May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to deploy-staging May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to deploy-production May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to npm deploy May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to bemo-canary May 19, 2026 09:13 Failure
@pull pull Bot had a problem deploying to deploy-staging May 19, 2026 09:13 Error
@pull pull Bot had a problem deploying to npm deploy May 19, 2026 09:13 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant