Checkboxes 改成 isEqual

This commit is contained in:
2betop 2020-05-27 16:27:34 +08:00
parent 4c7181c4c7
commit a7c568b605
1 changed files with 3 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import {ClassNamesFn, themeable, ThemeProps} from '../theme';
import {Option, value2array, Options} from './Select';
import find from 'lodash/find';
import {autobind, findTree} from '../utils/helper';
import isEqual from 'lodash/isEqual';
// import isPlainObject from 'lodash/isPlainObject';
export interface CheckboxesProps extends ThemeProps {
@ -52,9 +53,8 @@ export class Checkboxes<
}
return value.map((value: any) => {
const option = findTree(
options,
option => option2value(option) === value
const option = findTree(options, option =>
isEqual(option2value(option), value)
);
return option || value;
});