Skip to content

Commit 55379a8

Browse files
committed
Prevent input focus when missing configuration is present
1 parent b100162 commit 55379a8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/panel/PromptField/hooks/use-handlers.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ export const use_handlers = (
124124
])
125125

126126
useEffect(() => {
127-
if (params.input_ref.current) {
127+
if (params.input_ref.current && !props.missing_configuration) {
128128
params.input_ref.current.focus()
129129
}
130-
}, [props.focus_key])
130+
}, [props.focus_key, props.missing_configuration])
131131

132132
useEffect(() => {
133-
if (params.input_ref.current) {
133+
if (params.input_ref.current && !props.missing_configuration) {
134134
params.input_ref.current.focus()
135135
const selection = window.getSelection()
136136
if (selection) {
@@ -143,7 +143,7 @@ export const use_handlers = (
143143
selection.addRange(range)
144144
}
145145
}
146-
}, [props.focus_and_select_key])
146+
}, [props.focus_and_select_key, props.missing_configuration])
147147

148148
const update_value = (new_value: string, caret_pos?: number) => {
149149
if (new_value === props.value) return

0 commit comments

Comments
 (0)