0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

fix(Editor): make willPaste custom event to be cancelable

This commit is contained in:
Illia Kyselov 2024-02-08 11:36:30 +02:00 committed by Neil Jenkins
parent 73e9d083dd
commit 4d2c80de92

View file

@ -1075,6 +1075,7 @@ class Squire {
let doInsert = true; let doInsert = true;
if (isPaste) { if (isPaste) {
const event = new CustomEvent('willPaste', { const event = new CustomEvent('willPaste', {
cancelable: true,
detail: { detail: {
fragment: frag, fragment: frag,
}, },
@ -1205,6 +1206,7 @@ class Squire {
let doInsert = true; let doInsert = true;
if (isPaste) { if (isPaste) {
const event = new CustomEvent('willPaste', { const event = new CustomEvent('willPaste', {
cancelable: true,
detail: { detail: {
text: plainText, text: plainText,
}, },