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

refactor: restore search query string from localStorage (#715)

This commit is contained in:
olav 2022-02-17 09:19:01 +01:00 committed by GitHub
parent f862489fe8
commit 492435e1e4
3 changed files with 4 additions and 3 deletions

View File

@ -46,7 +46,7 @@ export const ApplicationList = () => {
return (
<>
<div className={commonStyles.searchField}>
<SearchField value={filter} updateValue={setFilter} />
<SearchField initialValue={filter} updateValue={setFilter} />
</div>
<PageContent headerContent={<HeaderTitle title="Applications" />}>
<div className={commonStyles.fullwidth}>

View File

@ -7,10 +7,10 @@ import SearchIcon from '@material-ui/icons/Search';
import { useStyles } from './styles';
function SearchField({ updateValue, className = '' }) {
function SearchField({ initialValue = '', updateValue, className = '' }) {
const styles = useStyles();
const [localValue, setLocalValue] = useState('');
const [localValue, setLocalValue] = useState(initialValue);
const debounceUpdateValue = debounce(updateValue, 500);
const handleChange = e => {

View File

@ -107,6 +107,7 @@ const FeatureToggleList = ({
<div className={styles.featureContainer}>
<div className={styles.searchBarContainer}>
<SearchField
initialValue={filter.query}
updateValue={setFilterQuery}
className={classnames(styles.searchBar, {
skeleton: loading,