diff --git a/frontend/src/pages/mobile/public/Schedule.jsx b/frontend/src/pages/mobile/public/Schedule.jsx index 76918b8..144a825 100644 --- a/frontend/src/pages/mobile/public/Schedule.jsx +++ b/frontend/src/pages/mobile/public/Schedule.jsx @@ -12,7 +12,8 @@ function MobileSchedule() { const [categories, setCategories] = useState([]); const [loading, setLoading] = useState(true); const [isSearchMode, setIsSearchMode] = useState(false); - const [searchTerm, setSearchTerm] = useState(''); + const [searchInput, setSearchInput] = useState(''); // 입력값 + const [searchTerm, setSearchTerm] = useState(''); // 실제 검색어 const [showCalendar, setShowCalendar] = useState(false); const [calendarViewDate, setCalendarViewDate] = useState(() => new Date(selectedDate)); // 달력 뷰 날짜 const [calendarShowYearMonth, setCalendarShowYearMonth] = useState(false); // 달력 년월 선택 모드 @@ -199,26 +200,34 @@ function MobileSchedule() { {/* 툴바 (헤더 + 날짜 선택기) */}
{isSearchMode ? ( -
-
- +
+
+ setSearchTerm(e.target.value)} - className="flex-1 bg-transparent outline-none text-sm" + value={searchInput} + onChange={(e) => setSearchInput(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + setSearchTerm(searchInput); + } + }} + className="flex-1 bg-transparent outline-none text-sm min-w-0" autoFocus /> - {searchTerm && ( - )}