summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/InputPrompt.tsx
diff options
context:
space:
mode:
authorEvan Senter <[email protected]>2025-04-18 18:14:45 +0100
committerEvan Senter <[email protected]>2025-04-18 18:16:52 +0100
commit97db77997fd6369031d2f1cf750051999fb0b5b5 (patch)
treeaed1947e1dd6b572b13bec5a5f48fb5b1690834a /packages/cli/src/ui/components/InputPrompt.tsx
parent3829ac635307a77a1af0141c2db7f4135c74fcf6 (diff)
Including a test harness for it, and making sure the cursor is always at the end.
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index f79aeaa3..1119926f 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -8,12 +8,14 @@ interface InputPromptProps {
setQuery: (value: string) => void;
onSubmit: (value: string) => void;
isActive: boolean;
+ forceKey: number;
}
const InputPrompt: React.FC<InputPromptProps> = ({
query,
setQuery,
onSubmit,
+ forceKey,
}) => {
const model = getModel();
@@ -22,6 +24,7 @@ const InputPrompt: React.FC<InputPromptProps> = ({
<Text color={'white'}>&gt; </Text>
<Box flexGrow={1}>
<TextInput
+ key={forceKey}
value={query}
onChange={setQuery}
onSubmit={onSubmit}