🐛 fix: Always update searchValue during IME composition to enable Chinese input in model search

Summary:
• Removed early return in `handleChange` that blocked controlled value updates while an Input Method Editor (IME) was composing text.
• Ensures that Chinese (and other IME-based) characters appear immediately in the “Fuzzy Search Model Name” field.
• No change to downstream filtering logic—`searchValue` continues to drive model list filtering as before.

Files affected:
web/src/hooks/model-pricing/useModelPricingData.js
This commit is contained in:
t0ng7u
2025-08-12 23:37:30 +08:00
parent 63b9457b6c
commit 196e2a0abb

View File

@@ -211,9 +211,6 @@ export const useModelPricingData = () => {
}; };
const handleChange = (value) => { const handleChange = (value) => {
if (compositionRef.current.isComposition) {
return;
}
const newSearchValue = value ? value : ''; const newSearchValue = value ? value : '';
setSearchValue(newSearchValue); setSearchValue(newSearchValue);
}; };
@@ -231,9 +228,7 @@ export const useModelPricingData = () => {
const handleGroupClick = (group) => { const handleGroupClick = (group) => {
setSelectedGroup(group); setSelectedGroup(group);
// 同时将分组过滤设置为该分组
setFilterGroup(group); setFilterGroup(group);
if (group === 'all') { if (group === 'all') {
showInfo(t('已切换至最优倍率视图,每个模型使用其最低倍率分组')); showInfo(t('已切换至最优倍率视图,每个模型使用其最低倍率分组'));
} else { } else {