fix:搜索框输入问题

This commit is contained in:
hzm
2026-02-17 10:22:03 +08:00
parent 6caf246010
commit e93dedca9f
2 changed files with 11 additions and 2 deletions

View File

@@ -434,6 +434,11 @@ input[type="number"] {
/* 防止 iOS 在输入时自动放大 */ /* 防止 iOS 在输入时自动放大 */
} }
.navbar-input-field {
font-size: 16px;
/* 防止 iOS 在输入时自动放大 */
}
.container { .container {
padding: 16px; padding: 16px;
} }

View File

@@ -1972,11 +1972,14 @@ export default function HomePage() {
clearTimeout(timer); clearTimeout(timer);
}; };
}, [groups, currentTab]); // groups 或 tab 变化可能导致 filterBar 高度变化 }, [groups, currentTab]); // groups 或 tab 变化可能导致 filterBar 高度变化
const handleMobileSearchClick = () => { const handleMobileSearchClick = (e) => {
e?.preventDefault();
e?.stopPropagation();
setIsSearchFocused(true); setIsSearchFocused(true);
// 等待动画完成后聚焦,避免 iOS 键盘弹出问题
setTimeout(() => { setTimeout(() => {
inputRef.current?.focus(); inputRef.current?.focus();
}, 100); }, 350);
}; };
const [holdingModal, setHoldingModal] = useState({ open: false, fund: null }); const [holdingModal, setHoldingModal] = useState({ open: false, fund: null });
@@ -3108,6 +3111,7 @@ export default function HomePage() {
setSearchTerm(''); setSearchTerm('');
setSelectedFunds([]); setSelectedFunds([]);
setShowDropdown(false); setShowDropdown(false);
inputRef.current?.blur();
setIsSearchFocused(false); setIsSearchFocused(false);
if (failures.length > 0) { if (failures.length > 0) {
setAddFailures(failures); setAddFailures(failures);