fix: fileManager did not close drawer after selecting files (#2716)

This commit is contained in:
katherinehhh 2023-09-26 11:37:21 +08:00 committed by GitHub
parent 261678dc56
commit 8db9fda61b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ const InternalFileManager = (props) => {
const collectionField = getField(field.props.name); const collectionField = getField(field.props.name);
const labelUiSchema = useLabelUiSchema(collectionField?.target, fieldNames?.label || 'label'); const labelUiSchema = useLabelUiSchema(collectionField?.target, fieldNames?.label || 'label');
const compile = useCompile(); const compile = useCompile();
const { setVisible, modalProps } = useActionContext(); const { modalProps } = useActionContext();
const getFilter = () => { const getFilter = () => {
const targetKey = collectionField?.targetKey || 'id'; const targetKey = collectionField?.targetKey || 'id';
const list = options.map((option) => option[targetKey]).filter(Boolean); const list = options.map((option) => option[targetKey]).filter(Boolean);
@ -121,6 +121,7 @@ const InternalFileManager = (props) => {
collectionField, collectionField,
}; };
const usePickActionProps = () => { const usePickActionProps = () => {
const { setVisible } = useActionContext();
const { multiple, selectedRows, onChange, options, collectionField } = useContext(RecordPickerContext); const { multiple, selectedRows, onChange, options, collectionField } = useContext(RecordPickerContext);
return { return {
onClick() { onClick() {