기록
검색 모달 오픈 시 input focus 되지 않는 경우 본문
setTimeout을 주어서 해결하였다.
searchBtn.addEventListener('click', () => {
modalWrapper.classList.add('visible');
setTimeout(() => {
searchInput.focus();
}, 300);
});
아직 보이지 않는 요소라서 focus가 되지 않았던 것으로 보인다.
'$' 카테고리의 다른 글
pc 가로 드래그 기능 (0) | 2022.07.21 |
---|---|
쇼핑몰 크롤링 해보기 (0) | 2022.06.22 |
web editor drag and drop (0) | 2021.12.27 |
scroll debounce (0) | 2021.12.14 |
Vanilla JS, jQuery 동적 이벤트 바인딩 (0) | 2021.12.10 |
Comments