mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 19:47:56 +08:00
Merge pull request #8211 from hsm-lv/fix-select
fix:Select值不变时不应触发change Close #8179
This commit is contained in:
commit
18d98337fd
@ -675,7 +675,10 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||
simpleValue ? selection.map(item => item[valueField]) : selection
|
||||
);
|
||||
} else {
|
||||
onChange(simpleValue ? selectItem[valueField] : selectItem);
|
||||
// Downshift里面的判断修改后的值是否相等时,没有区分是否多选,且用的是!==,所以这里拦截一下
|
||||
(!selection.length ||
|
||||
selection[0][valueField] !== selectItem[valueField]) &&
|
||||
onChange(simpleValue ? selectItem[valueField] : selectItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user