fix(select-component): remove filter sort

This commit is contained in:
chenos 2022-11-23 17:08:23 +08:00
parent d25276a23b
commit 6f4f601ba8

View File

@ -65,6 +65,8 @@ const ObjectSelect = (props: Props) => {
); );
}; };
const filterOption = (input, option) => (option?.label ?? '').toLowerCase().includes((input || '').toLowerCase());
export const Select = connect( export const Select = connect(
(props: Props) => { (props: Props) => {
const { objectValue, ...others } = props; const { objectValue, ...others } = props;
@ -74,10 +76,7 @@ export const Select = connect(
return ( return (
<AntdSelect <AntdSelect
showSearch showSearch
filterOption={(input, option) => (option?.label ?? '').includes(input)} filterOption={filterOption}
filterSort={(optionA, optionB) =>
(optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase())
}
allowClear allowClear
{...others} {...others}
onChange={(changed) => { onChange={(changed) => {