서치패널 왼쪽화살표 눌렀을때에 검색어존재시에 이동 조절
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user