fix(Select): title field and clear button not work (#1296)

* fix: add fieldNames to refreshDeps

* fix: clear not work

* fix: missing title in non-designer
This commit is contained in:
Dunqing 2022-12-29 22:28:35 +08:00 committed by GitHub
parent 0d732d214c
commit 71bfd78c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -39,10 +39,7 @@ const InternalAssociationSelect = connect(
(props: AssociationSelectProps) => {
const { fieldNames, objectValue = true } = props;
const service = useServiceOptions(props);
const field = useField();
const fieldSchema = useFieldSchema();
const { getField } = useCollection();
const collectionField = getField(fieldSchema.name);
useFieldTitle();
const normalizeValues = useCallback(
(obj) => {
@ -117,7 +114,6 @@ AssociationSelect.Designer = () => {
const defaultSort = field.componentProps?.service?.params?.sort || [];
const defaultFilter = field.componentProps?.service?.params?.filter || {};
const dataSource = useCollectionFilterOptions(collectionField?.target);
useFieldTitle();
const sort = defaultSort?.map((item: string) => {
return item.startsWith('-')

View File

@ -35,7 +35,7 @@ const InternalRemoteSelect = connect(
},
{
debounceWait: wait,
refreshDeps: [service],
refreshDeps: [service, fieldNames.label, fieldNames.value],
},
);

View File

@ -56,7 +56,7 @@ const ObjectSelect = (props: Props) => {
if (['tags', 'multiple'].includes(mode) || props.multiple) {
onChange(current);
} else {
onChange(current.shift());
onChange(current.shift() || null);
}
}}
mode={mode}