Commit fdd3bf3
fix(text): paste plain text instead of blocking paste in editable shapes (tldraw#8192)
When pasting tldraw clipboard data into an editable text shape (e.g. a
geo shape label or note), the paste was silently blocked. This PR fixes
it to extract and insert the plain text content from the clipboard
instead.
fixes tldraw#8187
### Change type
- [x] `bugfix`
### Test plan
1. Create two shapes with text (e.g. geo shapes with labels)
2. Select and copy one shape (Cmd+C)
3. Double-click the other shape to edit its text
4. Paste (Cmd+V) — the plain text from the copied shape should be
inserted
### Release notes
- Fix pasting into editable text shapes when clipboard contains tldraw
data
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: a small, localized change to paste handling for editable
text, with minimal impact outside the specific tldraw-clipboard paste
path.
>
> **Overview**
> Fixes paste into editable text shapes when the clipboard contains
tldraw HTML data. Instead of silently blocking the paste,
`useEditablePlainText` now prevents the default and inserts the
clipboard’s `text/plain` content via
`document.execCommand('insertText')` to preserve undo support.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0fa808b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Ani Krishnan <98394024+anikrisn@users.noreply.github.com>1 parent 81d57bb commit fdd3bf3
1 file changed
Lines changed: 6 additions & 0 deletions
File tree
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
0 commit comments