mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Clear features filter on reset all
Also add enableReinitialize and keepDirtyOnReinitialize props to the form to enable filter clear without a destroy call to the form.
This commit is contained in:
parent
a176df4154
commit
7bafc7e071
3 changed files with 4 additions and 6 deletions
|
|
@ -100,7 +100,7 @@ class SearchFiltersMobileComponent extends Component {
|
|||
resetAll(e) {
|
||||
const { urlQueryParams, history } = this.props;
|
||||
|
||||
const queryParams = omit(urlQueryParams, CATEGORY_URL_PARAM);
|
||||
const queryParams = omit(urlQueryParams, [CATEGORY_URL_PARAM, FEATURES_URL_PARAM]);
|
||||
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
|
||||
|
||||
// blur event target if event is passed
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ const SelectMultipleFilterMobile = props => {
|
|||
initialValuesCount={initialValues.length}
|
||||
onChange={handleSelect}
|
||||
onClear={handleClear}
|
||||
enableReinitialize={true}
|
||||
keepDirtyOnReinitialize={true}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -17,11 +17,7 @@ class SelectMultipleFilterMobileFormComponent extends Component {
|
|||
}
|
||||
|
||||
handleClear() {
|
||||
const { destroy, onClear } = this.props;
|
||||
// destroy redux form state so that initial values passed
|
||||
// to the form are also cleared
|
||||
destroy();
|
||||
onClear();
|
||||
this.props.onClear();
|
||||
}
|
||||
|
||||
toggleIsOpen() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue