Skip to content
Snippets Groups Projects
Commit 93125e4e authored by Dima Rifai's avatar Dima Rifai
Browse files

Issue #393 - Fix autocomplete focus on backspace event

parent 616d7295
No related branches found
No related tags found
1 merge request!496Issue #393 - Fix autocomplete focus on backspace event
Pipeline #111547 failed
......@@ -144,22 +144,11 @@ const AutocompleteInput: React.FC<AutocompleteInputProps> = ({
inputRef.current?.focus();
linkResult ? "" : closeSearchBar();
}
}
};
useEffect(() => {
const keyDownEvent = (event: KeyboardEvent) => {
if (event.key === "Backspace") {
setInputFocus(true); // Reopen the suggestions on backspace
}
};
document.addEventListener("keydown", keyDownEvent);
return () => {
document.removeEventListener("keydown", keyDownEvent);
};
}, []);
}
};
// Ensure the selected result is visible in the scrollable container
useEffect(() => {
if (selectedResultRef.current) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment