fix: issue with fuzzy search support for association fields with string-type title field (#5611)

This commit is contained in:
Katherine 2024-11-07 15:21:13 +08:00 committed by GitHub
parent c4653cb784
commit 666c92d524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]);