Skip to content

Commit

Permalink
patch: allow copying text for bound text
Browse files Browse the repository at this point in the history
  • Loading branch information
Fausto95 committed Apr 5, 2022
1 parent f9a8139 commit b26baa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/actions/actionClipboard.tsx
Expand Up @@ -4,7 +4,7 @@ import { copyTextToSystemClipboard, copyToClipboard } from "../clipboard";
import { actionDeleteSelected } from "./actionDeleteSelected";
import { getSelectedElements } from "../scene/selection";
import { exportCanvas } from "../data/index";
import { getNonDeletedElements } from "../element";
import { getNonDeletedElements, isTextElement } from "../element";
import { t } from "../i18n";

export const actionCopy = register({
Expand Down Expand Up @@ -134,11 +134,11 @@ export const copyAllTextNodesAsText = register({
const selectedElements = getSelectedElements(
getNonDeletedElements(elements),
appState,
false,
true,
);

const text = selectedElements.reduce((acc, element) => {
if (element.type === "text") {
if (isTextElement(element)) {
return `${acc}${element.text}\n\n`;
}
return acc;
Expand Down

0 comments on commit b26baa4

Please sign in to comment.