From 6f4f601ba81fb4c3fc1e981721468492adda7ede Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 23 Nov 2022 17:08:23 +0800 Subject: [PATCH] fix(select-component): remove filter sort --- .../client/src/schema-component/antd/select/Select.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/select/Select.tsx b/packages/core/client/src/schema-component/antd/select/Select.tsx index a3e11795e3..9dd5018813 100644 --- a/packages/core/client/src/schema-component/antd/select/Select.tsx +++ b/packages/core/client/src/schema-component/antd/select/Select.tsx @@ -65,6 +65,8 @@ const ObjectSelect = (props: Props) => { ); }; +const filterOption = (input, option) => (option?.label ?? '').toLowerCase().includes((input || '').toLowerCase()); + export const Select = connect( (props: Props) => { const { objectValue, ...others } = props; @@ -74,10 +76,7 @@ export const Select = connect( return ( (option?.label ?? '').includes(input)} - filterSort={(optionA, optionB) => - (optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase()) - } + filterOption={filterOption} allowClear {...others} onChange={(changed) => {