mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
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) => {
|
||||
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('-')
|
||||
|
@ -35,7 +35,7 @@ const InternalRemoteSelect = connect(
|
||||
},
|
||||
{
|
||||
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) {
|
||||
onChange(current);
|
||||
} else {
|
||||
onChange(current.shift());
|
||||
onChange(current.shift() || null);
|
||||
}
|
||||
}}
|
||||
mode={mode}
|
||||
|
Loading…
Reference in New Issue
Block a user