서치패널 왼쪽화살표 눌렀을때에 검색어존재시에 이동 조절

This commit is contained in:
junghoon86.park
2024-08-02 14:53:21 +09:00
parent 916d567b4b
commit 68ca386489

View File

@@ -55,9 +55,14 @@ export default function TInput({
const handleBoxKeyDown = useCallback((e) => {
if (e.key === "ArrowLeft" || e.key === "Left") {
e.preventDefault();
e.stopPropagation();
Spotlight.focus("spotlight_search");
const currentElement = e.currentTarget;
const inputElement = currentElement.querySelector("input");
if (inputElement.value.length === 0) {
e.preventDefault();
e.stopPropagation();
Spotlight.focus("spotlight_search");
}
}
}, []);