From 64aa5bde06f74d0c9d66b4bc31a09cecb8965e25 Mon Sep 17 00:00:00 2001 From: Youssef Date: Wed, 24 Nov 2021 11:41:43 +0100 Subject: [PATCH] fix: clear search input on route change --- .../feature/FeatureToggleList/FeatureToggleList.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleList.jsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleList.jsx index ee0c1643aa..c123bdb4ae 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleList.jsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleList.jsx @@ -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 = ({