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:
parent
0d732d214c
commit
71bfd78c6b
@ -39,10 +39,7 @@ const InternalAssociationSelect = connect(
|
|||||||
(props: AssociationSelectProps) => {
|
(props: AssociationSelectProps) => {
|
||||||
const { fieldNames, objectValue = true } = props;
|
const { fieldNames, objectValue = true } = props;
|
||||||
const service = useServiceOptions(props);
|
const service = useServiceOptions(props);
|
||||||
const field = useField();
|
useFieldTitle();
|
||||||
const fieldSchema = useFieldSchema();
|
|
||||||
const { getField } = useCollection();
|
|
||||||
const collectionField = getField(fieldSchema.name);
|
|
||||||
|
|
||||||
const normalizeValues = useCallback(
|
const normalizeValues = useCallback(
|
||||||
(obj) => {
|
(obj) => {
|
||||||
@ -117,7 +114,6 @@ AssociationSelect.Designer = () => {
|
|||||||
const defaultSort = field.componentProps?.service?.params?.sort || [];
|
const defaultSort = field.componentProps?.service?.params?.sort || [];
|
||||||
const defaultFilter = field.componentProps?.service?.params?.filter || {};
|
const defaultFilter = field.componentProps?.service?.params?.filter || {};
|
||||||
const dataSource = useCollectionFilterOptions(collectionField?.target);
|
const dataSource = useCollectionFilterOptions(collectionField?.target);
|
||||||
useFieldTitle();
|
|
||||||
|
|
||||||
const sort = defaultSort?.map((item: string) => {
|
const sort = defaultSort?.map((item: string) => {
|
||||||
return item.startsWith('-')
|
return item.startsWith('-')
|
||||||
|
@ -35,7 +35,7 @@ const InternalRemoteSelect = connect(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
debounceWait: wait,
|
debounceWait: wait,
|
||||||
refreshDeps: [service],
|
refreshDeps: [service, fieldNames.label, fieldNames.value],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ const ObjectSelect = (props: Props) => {
|
|||||||
if (['tags', 'multiple'].includes(mode) || props.multiple) {
|
if (['tags', 'multiple'].includes(mode) || props.multiple) {
|
||||||
onChange(current);
|
onChange(current);
|
||||||
} else {
|
} else {
|
||||||
onChange(current.shift());
|
onChange(current.shift() || null);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
|
Loading…
Reference in New Issue
Block a user