mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Allow copy of excalidraw elements only when inside excalidraw (#3206)
* fix: Allow copy event only inside canvas * use pointerdown * use document.getSelection * remove poiterdown * remove keyTest * update changelog
This commit is contained in:
parent
1f7f07fbfb
commit
00ac804dd8
4 changed files with 10 additions and 1 deletions
|
@ -1028,6 +1028,13 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
});
|
||||
|
||||
private onCopy = withBatchedUpdates((event: ClipboardEvent) => {
|
||||
const activeSelection = document.getSelection();
|
||||
if (
|
||||
activeSelection?.anchorNode &&
|
||||
!this.excalidrawContainerRef.current!.contains(activeSelection.anchorNode)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (isWritableElement(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue