FormDataConsumer not working properly inside 'Filter'
See original GitHub issueWhat you were expecting:
FormDataConsumer
to be used in Filters, so that we can have a filter with subcat
values filtered based on another filter with cat
values.
What happened instead: The filter does not appear correctly:
Other information:
<FormDataConsumer>
{({ formData, ...rest }) =>
formData.cat_id && (
<ReferenceInput
// key={formData.cat_id}
label="ΥΠΟΚΑΤΗΓΟΡΙΑ"
source="subCat_id"
reference="subCategories"
filter={{ cat_id: formData.cat_id }}
{...rest}
>
<SelectInput optionText="name" />
</ReferenceInput>
)
}
</FormDataConsumer>
Environment
- React-admin version: v2.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
FormDataConsumer Within Filter - react admin - Stack Overflow
EDIT: I have tried using the FormDataConsumer within a Filter and I could not get it to work. Using dev tools in the...
Read more >Input Components - React-admin - Marmelab
Such components allow to update a record field and are common in the <Edit> and <Create> components, and in the List Filters. Inputs....
Read more >React-select-fast-filter-options does not work properly-Reactjs
[Solved]-React-select-fast-filter-options does not work properly-Reactjs ... I use an asynchronous javascript function like fetch inside a FormDataConsumer ...
Read more >CHANGELOG.md · 邹昊坤/marmelab-react-admin - Gitee.com
... format ([#2655](https://github.com/marmelab/react-admin/pull/2655)) ([fzaninotto](https://github.com/fzaninotto)) * Fix `<FormDataConsumer>` not working ...
Read more >how to disable input field based on condition react - You.com
Its not data.valid .. its obj.valid in Input field ... <Button disabled={!activityChanged} loading={submitting} floated="right" positive type="submit" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Found solution to filter based on another filter without FormDataConsumer
Works like a charm
In case anyone cames in here wondering how to reset the dependent filter value, here is a solution: