fix: 검색 스크롤 초기화 개선
- virtualizer.scrollToOffset(0) 사용 - DOM 스크롤도 함께 초기화 (fallback)
This commit is contained in:
parent
ff2c596865
commit
d84ab36a83
1 changed files with 7 additions and 2 deletions
|
|
@ -68,8 +68,13 @@ function MobileSchedule() {
|
||||||
|
|
||||||
// 검색어 변경 시 스크롤 위치 초기화
|
// 검색어 변경 시 스크롤 위치 초기화
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (scrollContainerRef.current && searchTerm) {
|
if (searchTerm) {
|
||||||
scrollContainerRef.current.scrollTop = 0;
|
// virtualizer 스크롤 초기화
|
||||||
|
virtualizer.scrollToOffset(0);
|
||||||
|
// DOM 스크롤도 초기화 (fallback)
|
||||||
|
if (scrollContainerRef.current) {
|
||||||
|
scrollContainerRef.current.scrollTop = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [searchTerm]);
|
}, [searchTerm]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue