fix: addressed suggestion incomplete issue

This commit is contained in:
Sheen Capadngan
2024-04-26 18:46:16 +08:00
parent 656ec4bf16
commit 5ff30aed10
@@ -43,10 +43,7 @@ export const SecretPathInput = ({
}); });
useEffect(() => { useEffect(() => {
const initialValue = propValue ?? "/"; setInputValue(propValue ?? "/");
setInputValue(initialValue);
setSecretPath(initialValue);
onChange?.({ target: { value: initialValue } } as any);
}, [propValue]); }, [propValue]);
useEffect(() => { useEffect(() => {
@@ -69,7 +66,6 @@ export const SecretPathInput = ({
// filter suggestions based on matching // filter suggestions based on matching
const searchFragment = debouncedInputValue.split("/").pop() || ""; const searchFragment = debouncedInputValue.split("/").pop() || "";
const filteredSuggestions = folders const filteredSuggestions = folders
.filter((suggestionEntry) => .filter((suggestionEntry) =>
suggestionEntry.toUpperCase().startsWith(searchFragment.toUpperCase()) suggestionEntry.toUpperCase().startsWith(searchFragment.toUpperCase())