mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: onPaste should return false to prevent paste action (#3974)
* Update App.tsx * Update README_NEXT.md * Update CHANGELOG.md * Update App.tsx * Update App.tsx * Update src/packages/excalidraw/CHANGELOG.md * fix lint Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
5da3207633
commit
7d1fddc144
3 changed files with 15 additions and 3 deletions
|
@ -1193,8 +1193,12 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}
|
||||
const data = await parseClipboard(event);
|
||||
if (this.props.onPaste) {
|
||||
if (await this.props.onPaste(data, event)) {
|
||||
return;
|
||||
try {
|
||||
if ((await this.props.onPaste(data, event)) === false) {
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
if (data.errorMessage) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue