Refactor: enable node copy for multiple selection

This commit is contained in:
igorrCarvalho 2024-06-28 03:32:59 -03:00
commit 63113aa8ea

View file

@ -228,7 +228,8 @@ export default function Page({
}
function handleCopy(e: KeyboardEvent) {
if (!isWrappedWithClass(e, "nocopy") && isWrappedWithClass(e, "react-flow__node")) {
const multipleSelection = lastSelection?.nodes ? lastSelection?.nodes.length > 0 : false;
if (!isWrappedWithClass(e, "nocopy") && (isWrappedWithClass(e, "react-flow__node") || multipleSelection)) {
e.preventDefault();
(e as unknown as Event).stopImmediatePropagation();
if (window.getSelection()?.toString().length === 0 && lastSelection) {