react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Using filter on ReferenceArrayInput prevents data from being rendered

Open TomJannes opened this issue 7 years ago • 1 comments

What you were expecting: My data shown in the ReferenceArrayInput

What happened instead: Nothing is rendered in the ReferenceArrayInput

Steps to reproduce: Use a filter on a ReferenceArrayInput

Related code:

onChangeFilter = (props) => {
        const {
            change,
            customer,
            id
        } = this.props;
        change('record-form', 'timeSheetIds', null);
        return { isLinkedToInvoice: false, ignoreInvoiceId: id };
    }

<ReferenceArrayInput
                                label="Timesheets"
                                resource={resource}
                                source="timeSheetIds"
                                reference="timesheets"
                                filter={this.onChangeFilter(this.props)}
                                allowEmpty>
                                <SelectArrayInput optionText="description" />
                            </ReferenceArrayInput>

Other information: If i remove the filter, the data is rendered The api is queryied succesfully using the filter

Environment

  • React-admin version: 2.8.4
  • React version: 16.6.3
  • Browser: chrome

TomJannes avatar Apr 17 '19 12:04 TomJannes

never mind, found the issue...

TomJannes avatar Apr 17 '19 13:04 TomJannes