diff --git a/src/components/CommandBar/CommandBarSelectionInput.tsx b/src/components/CommandBar/CommandBarSelectionInput.tsx index b821e04e3..c6106b7b8 100644 --- a/src/components/CommandBar/CommandBarSelectionInput.tsx +++ b/src/components/CommandBar/CommandBarSelectionInput.tsx @@ -7,6 +7,7 @@ import { getSelectionType, getSelectionTypeDisplayText, } from 'lib/selections' +import { kclManager } from 'lib/singletons' import { modelingMachine } from 'machines/modelingMachine' import { useCallback, useEffect, useRef, useState } from 'react' import { useHotkeys } from 'react-hotkeys-hook' @@ -50,6 +51,14 @@ function CommandBarSelectionInput({ inputRef.current?.focus() }, [selection, inputRef]) + // Exit engine's edit mode when this input step is active, + // and re-enter it when it's not. + // In future the engine's edit mode will go away and this will be handled differently. + useEffect(() => { + kclManager.exitEditMode() + return () => kclManager.enterEditMode() + }, []) + // Fast-forward through this arg if it's marked as skippable // and we have a valid selection already useEffect(() => {