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 2f0ecedef4d..b19811c2b15 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 e1b8b2a4466..5d2932ab347 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 } })