Skip to content

Commit

Permalink
Copy handler: only handle paste event once
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar committed Sep 2, 2021
1 parent da052f0 commit 8010a59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/block-editor/src/components/copy-handler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ export function useClipboardHandler() {
if ( event.type === 'cut' ) {
removeBlocks( selectedBlockClientIds );
} else if ( event.type === 'paste' ) {
if (
event.defaultPrevented &&
event.target.classList.contains(
'block-editor-rich-text__editable'
)
) {
// If event originated from rich text this was already handled in rich-text/use-paste-handler.js
return;
}
const {
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML,
} = getSettings();
Expand Down

0 comments on commit 8010a59

Please sign in to comment.