Skip to content

Commit

Permalink
Allow clear text (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitenite authored Sep 16, 2024
1 parent 30279eb commit c72fad3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/electron/main/code/diff/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function transformAst(
if (codeDiffRequest.attributes && codeDiffRequest.attributes.className) {
addClassToNode(path.node, codeDiffRequest.attributes.className);
}
if (codeDiffRequest.textContent) {
if (codeDiffRequest.textContent !== undefined) {
updateNodeTextContent(path.node, codeDiffRequest.textContent);
}
const structureChangeElements = getStructureChangeElements(codeDiffRequest);
Expand Down
4 changes: 3 additions & 1 deletion app/src/routes/project/Canvas/HotkeysArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const HotkeysArea = ({ children, scale, setScale }: HotkeysAreaProps) => {
useHotkeys(Hotkey.UNDO.command, () => editorEngine.action.undo());
useHotkeys(Hotkey.REDO.command, () => editorEngine.action.redo());
useHotkeys('enter', () => editorEngine.textEditSelectedElement());
useHotkeys('esc', () => editorEngine.clear());
useHotkeys('esc', () => {
!editorEngine.text.isEditing && editorEngine.clear();
});

return <>{children}</>;
};
Expand Down

0 comments on commit c72fad3

Please sign in to comment.