copy/paste: fix pasting not working from Edit menu (#3623)

Looks like this has been broken for a while actually. I spelunked into
the history of git blame around why we needed this but can't find when
it was added easily. (maybe it was in brivate?)

I don't _think_ we need the menu check anymore but lemme know if there's
something I'm missing here @steveruizok

### Change Type

<!--  Please select a 'Scope' label ️ -->

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

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


### Release Notes

- Clipboard: fix pasting from the Edit menu.
pull/3609/head^2
Mime Čuvalo 2024-04-29 15:10:05 +01:00 zatwierdzone przez GitHub
rodzic 4da28a0ddd
commit bf42d6e2a9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -584,7 +584,7 @@ export function useMenuClipboardEvents() {
// If we're editing a shape, or we are focusing an editable input, then
// we would want the user's paste interaction to go to that element or
// input instead; e.g. when pasting text into a text shape's content
if (editor.getEditingShapeId() !== null || disallowClipboardEvents(editor)) return
if (editor.getEditingShapeId() !== null) return
if (Array.isArray(data) && data[0] instanceof ClipboardItem) {
handlePasteFromClipboardApi(editor, data, point)