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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user