From 578ab255684ffee8a01d2963ba6d4706df78d140 Mon Sep 17 00:00:00 2001 From: caadiq Date: Fri, 9 Jan 2026 15:04:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EB=82=A0=EC=A7=9C=20=EB=B3=80=EA=B2=BD=20=EC=8B=9C?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EB=A7=A8=20=EC=9C=84=EB=A1=9C?= =?UTF-8?q?=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - contentRef 추가하여 mobile-content 요소 참조 - selectedDate 변경 시 useEffect로 scrollTop = 0 설정 --- frontend/src/pages/mobile/Schedule.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/mobile/Schedule.jsx b/frontend/src/pages/mobile/Schedule.jsx index f1c6348..a9f08ba 100644 --- a/frontend/src/pages/mobile/Schedule.jsx +++ b/frontend/src/pages/mobile/Schedule.jsx @@ -15,6 +15,7 @@ function MobileSchedule() { const [showCalendar, setShowCalendar] = useState(false); const [calendarViewDate, setCalendarViewDate] = useState(() => new Date(selectedDate)); // 달력 뷰 날짜 const [calendarShowYearMonth, setCalendarShowYearMonth] = useState(false); // 달력 년월 선택 모드 + const contentRef = useRef(null); // 스크롤 초기화용 // 달력 월 변경 함수 const changeCalendarMonth = (delta) => { @@ -97,6 +98,13 @@ function MobileSchedule() { setCalendarViewDate(newDate); }; + // 날짜 변경 시 스크롤 맨 위로 초기화 + useEffect(() => { + if (contentRef.current) { + contentRef.current.scrollTop = 0; + } + }, [selectedDate]); + // 캘린더가 열릴 때 배경 스크롤 방지 useEffect(() => { @@ -422,7 +430,7 @@ function MobileSchedule() { {/* 컨텐츠 영역 */} -
+
{isSearchMode && searchTerm ? ( // 검색 결과