File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/ra-ui-materialui/src/list/filter Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 99 useContext ,
1010 useEffect ,
1111} from 'react' ;
12- import { useFormContext } from 'react-hook-form' ;
1312
1413import { FilterContext } from '../FilterContext' ;
1514import { FilterFormInput } from './FilterFormInput' ;
@@ -30,8 +29,11 @@ export type FilterFormProps = FilterFormBaseProps;
3029export const FilterFormBase = ( props : FilterFormBaseProps ) => {
3130 const { filters } = props ;
3231 const resource = useResourceContext ( props ) ;
33- const form = useFormContext ( ) ;
34- const { displayedFilters = { } , hideFilter } = useListContext ( ) ;
32+ const {
33+ displayedFilters = { } ,
34+ filterValues,
35+ hideFilter,
36+ } = useListContext ( ) ;
3537
3638 useEffect ( ( ) => {
3739 if ( ! filters ) return ;
@@ -46,7 +48,7 @@ export const FilterFormBase = (props: FilterFormBaseProps) => {
4648
4749 const getShownFilters = ( ) => {
4850 if ( ! filters ) return [ ] ;
49- const values = form . getValues ( ) ;
51+ const values = filterValues ;
5052 return filters . filter ( ( filterElement : React . ReactElement ) => {
5153 const filterValue = get ( values , filterElement . props . source ) ;
5254 return (
You can’t perform that action at this time.
0 commit comments