我有一个简单的带有ReferenceInput的react管理员编辑表单。问题是ReferenceInput从不显示进度条,因此用户在加载时看不到任何选项可能会感到困惑。
我在API调用上手动设置延迟2秒,但ReferenceInput从不显示加载状态。
import React from 'react';
import { ReferenceInput, ReferenceArrayInput, required, SelectArrayInput, SelectInput, SimpleForm, TextInput } from 'react-admin';
const ModelForm = props => (
<SimpleForm {...props}>
<TextInput source="name" validate={[required()]} />
<ReferenceInput reference="goods_types" source="goodsType" validate={[required()]}>
<SelectInput optionText="name" />
</ReferenceInput>
<ReferenceInput reference="manufacturers" source="manufacturer" validate={[required()]}>
<SelectInput optionText="name" />
</ReferenceInput>
<ReferenceArrayInput reference="manufacturers" source="manufacturer" format={v => [v]} validate={[required()]}>
<SelectArrayInput optionText="name" />
</ReferenceArrayInput>
</SimpleForm>
);
export default ModelForm;
只是为了测试,我添加了ReferenceArrayInput组件,它确实显示了加载进度条。它是react admin中的bug吗?还是我错过了什么?
反应管理员:3.11.1
参考:https://github.com/marmelab/react-admin/blob/ea1f85c73f5be8f12544a0fccf32e4f6bd7452be/packages/ra-ui-materialui/src/layout/LinearProgress.tsx