1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: clear search input on route change

This commit is contained in:
Youssef 2021-11-24 11:41:43 +01:00
parent 47bfda1f7b
commit 64aa5bde06

View File

@ -1,4 +1,4 @@
import { useContext, useLayoutEffect } from 'react';
import { useContext, useLayoutEffect, useEffect } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { Link } from 'react-router-dom';
@ -46,6 +46,11 @@ const FeatureToggleList = ({
fetcher();
}, [fetcher]);
useEffect(() => {
updateSetting('filter', '');
/* eslint-disable-next-line */
}, []);
const toggleMetrics = () => {
updateSetting('showLastHour', !settings.showLastHour);
};
@ -74,7 +79,6 @@ const FeatureToggleList = ({
hasAccess={hasAccess}
className={'skeleton'}
flags={flags}
archive={archive}
/>
));
}
@ -125,7 +129,6 @@ const FeatureToggleList = ({
<div className={styles.featureContainer}>
<div className={styles.searchBarContainer}>
<SearchField
value={settings.filter}
updateValue={updateSetting.bind(this, 'filter')}
className={classnames(styles.searchBar, {
skeleton: loading,