fix(watchlist): 종목 검색 debounce 중 '결과 없음' 오표시 - #102
Merged
Conversation
- query 빈 문자열일 때 results를 [] 로 초기화하지 않던 문제 수정 - debounce 대기 중(searching=true)에는 '검색 결과가 없습니다' 문구 숨김 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
빈 query 시 setResults/setSearching 동기 호출을 onChange 핸들러로 이동 (react-hooks/no-set-state-in-effect).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
종목 추가 모달에서 "하이닉스" 등 검색 시 백엔드는 결과를 반환하는데 UI에는 "검색 결과가 없습니다"로 표시되던 버그.
Root cause (
SearchInput.tsx):hasQuery=true즉시 드롭다운 열리지만 300ms debounce 중에는results.length===0→ "결과 없음" 텍스트가 먼저 보임setResults([])누락 → 이전 결과 잔류Fix (+7/-2):
searchingstate 추가, debounce 진행 중true!searching && results.length === 0조건으로 "결과 없음" 표시 제어setResults([])+setSearching(false)호출Test plan
🤖 Generated with Claude Code