🐛 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:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user