diff --git a/client/src/pages/databases/collections/search/VectorInputBox.tsx b/client/src/pages/databases/collections/search/VectorInputBox.tsx index 89ac7974..b2e0a64c 100644 --- a/client/src/pages/databases/collections/search/VectorInputBox.tsx +++ b/client/src/pages/databases/collections/search/VectorInputBox.tsx @@ -143,19 +143,6 @@ export default function VectorInputBox(props: VectorInputBoxProps) { onChangeRef.current = onChange; fieldRef.current = field; searchParamsRef.current = searchParams; - - if (editor.current) { - // only data replace should trigger this, otherwise, let cm handle the state - if (editor.current.state.doc.toString() !== data) { - editor.current.dispatch({ - changes: { - from: 0, - to: data.length + 1, - insert: data, - }, - }); - } - } }, [JSON.stringify(searchParams), onChange]); const getVectorById = (text: string) => { @@ -293,6 +280,7 @@ export default function VectorInputBox(props: VectorInputBoxProps) { editor.current.dispatch({ selection: { anchor: endPos }, }); + editor.current.focus(); return () => { @@ -300,7 +288,7 @@ export default function VectorInputBox(props: VectorInputBoxProps) { editor.current = undefined; }; } - }, [JSON.stringify(field), getVectorById]); + }, [JSON.stringify({ field, data })]); useEffect(() => { // dispatch dark mode change to editor diff --git a/client/src/pages/search/SearchParams.tsx b/client/src/pages/search/SearchParams.tsx index b3822bf7..47974ebc 100644 --- a/client/src/pages/search/SearchParams.tsx +++ b/client/src/pages/search/SearchParams.tsx @@ -216,7 +216,6 @@ const SearchParams: FC = ({ isInt: false, required: false, handleChange: value => { - console.log(value, typeof value); handleInputChange('radius', value); }, className: classes.inlineInput,