From 666c92d524da14db934f87f393dd0bc5ff4853ac Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 7 Nov 2024 15:21:13 +0800 Subject: [PATCH] fix: issue with fuzzy search support for association fields with string-type title field (#5611) --- .../schema-component/antd/remote-select/RemoteSelect.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx index 86f521c188..8597efcd33 100644 --- a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx +++ b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx @@ -82,8 +82,12 @@ const InternalRemoteSelect = connect( const operator = useMemo(() => { if (targetField?.interface) { - const initialOperator = getInterface(targetField.interface)?.filterable?.operators[0].value || '$includes'; - return initialOperator !== '$eq' ? initialOperator : '$includes'; + const targetInterface = getInterface(targetField.interface); + const initialOperator = targetInterface?.filterable?.operators[0].value || '$includes'; + if (targetField.type === 'string') { + return '$includes'; + } + return initialOperator; } return '$includes'; }, [targetField]);