Skip to content

Commit

Permalink
Fix E2E bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreatercurve committed Mar 25, 2022
1 parent 4611df8 commit bfa9a0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 52 deletions.
1 change: 0 additions & 1 deletion packages/lexical-playground/src/nodes/ImageNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ function ImageComponent({
}
setSelected(false);
});
return true;
}
return false;
},
Expand Down
54 changes: 3 additions & 51 deletions packages/lexical-rich-text/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,45 +615,6 @@ export function registerRichText(
},
0,
),
editor.registerCommandListener(
'copy',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
const event: ClipboardEvent = payload;
onCopyForRichText(event, editor);
return true;
},
0,
),
editor.registerCommandListener(
'cut',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
const event: ClipboardEvent = payload;
onCutForRichText(event, editor);
return true;
},
0,
),
editor.registerCommandListener(
'paste',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
const event: ClipboardEvent = payload;
onPasteForRichText(event, editor);
return true;
},
0,
),
editor.registerCommandListener(
'drop',
(payload) => {
Expand Down Expand Up @@ -686,10 +647,7 @@ export function registerRichText(
'copy',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
if ($isGridSelection(selection)) {
if ($isRangeSelection(selection) || $isGridSelection(selection)) {
const event: ClipboardEvent = payload;
onCopyForRichText(event, editor);
return true;
Expand All @@ -702,10 +660,7 @@ export function registerRichText(
'cut',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
if ($isGridSelection(selection)) {
if ($isRangeSelection(selection) || $isGridSelection(selection)) {
const event: ClipboardEvent = payload;
onCutForRichText(event, editor);
return true;
Expand All @@ -718,10 +673,7 @@ export function registerRichText(
'paste',
(payload) => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
if ($isGridSelection(selection)) {
if ($isRangeSelection(selection) || $isGridSelection(selection)) {
const event: ClipboardEvent = payload;
onPasteForRichText(event, editor);
return true;
Expand Down

0 comments on commit bfa9a0b

Please sign in to comment.