From ee2fa95a998b255f0359400e95ad8d2c527b002a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 25 Sep 2023 12:25:55 +0200 Subject: [PATCH] bug renaming --- libs/remix-ui/workspace/src/lib/components/file-label.tsx | 4 ++++ libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/components/file-label.tsx b/libs/remix-ui/workspace/src/lib/components/file-label.tsx index 2f0ecedef4..b19811c2b1 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-label.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-label.tsx @@ -52,6 +52,10 @@ export const FileLabel = (props: FileLabelProps) => { editModeOff(labelRef.current.innerText) labelRef.current.innerText = file.name } + if (event.which === 27) { + event.preventDefault() + editModeOff(labelRef.current.innerText) + } } const handleEditBlur = (event: React.SyntheticEvent) => { diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index e1b8b2a446..5d2932ab34 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -469,7 +469,7 @@ export function Workspace() { return { ...prevState, focusContext: {element: path, x: pageX, y: pageY, type}, - focusEdit: {...prevState.focusEdit, lastEdit: content}, + focusEdit: {...prevState.focusEdit, element: null, lastEdit: content}, showContextMenu: prevState.focusEdit.element !== path } })