parent
6d8ce5361a
commit
c4722ae884
6 changed files with 18 additions and 0 deletions
|
@ -105,6 +105,7 @@ export const SearchBar = (props: Props): JSX.Element => {
|
|||
const url = `${query.template}${search}`;
|
||||
redirectUrl(url, sameTab);
|
||||
}
|
||||
if(config.autoClearSearch) clearSearch();
|
||||
} else if (e.code === 'Escape') {
|
||||
clearSearch();
|
||||
}
|
||||
|
|
|
@ -130,6 +130,19 @@ export const SearchSettings = (): JSX.Element => {
|
|||
</select>
|
||||
</InputGroup>
|
||||
|
||||
<InputGroup>
|
||||
<label htmlFor={"autoClearSearch"}>Automatically clear the search bar</label>
|
||||
<select
|
||||
id={"autoClearSearch"}
|
||||
name={"autoClearSearch"}
|
||||
value={formData.autoClearSearch ? 1 : 0}
|
||||
onChange={(e) => inputChangeHandler(e, { isBool: true })}
|
||||
>
|
||||
<option value={1}>True</option>
|
||||
<option value={0}>False</option>
|
||||
</select>
|
||||
</InputGroup>
|
||||
|
||||
<Button>Save changes</Button>
|
||||
</form>
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ export interface Config {
|
|||
hideCategories: boolean;
|
||||
hideSearch: boolean;
|
||||
defaultSearchProvider: string;
|
||||
autoClearSearch: boolean;
|
||||
dockerApps: boolean;
|
||||
dockerHost: string;
|
||||
kubernetesApps: boolean;
|
||||
|
|
|
@ -13,6 +13,7 @@ export interface SearchForm {
|
|||
defaultSearchProvider: string;
|
||||
searchSameTab: boolean;
|
||||
disableAutofocus: boolean;
|
||||
autoClearSearch: boolean;
|
||||
}
|
||||
|
||||
export interface OtherSettingsForm {
|
||||
|
|
|
@ -17,6 +17,7 @@ export const configTemplate: Config = {
|
|||
hideCategories: false,
|
||||
hideSearch: false,
|
||||
defaultSearchProvider: 'l',
|
||||
autoClearSearch: false,
|
||||
dockerApps: false,
|
||||
dockerHost: 'localhost',
|
||||
kubernetesApps: false,
|
||||
|
|
|
@ -38,6 +38,7 @@ export const searchSettingsTemplate: SearchForm = {
|
|||
searchSameTab: false,
|
||||
defaultSearchProvider: 'l',
|
||||
disableAutofocus: false,
|
||||
autoClearSearch: false,
|
||||
};
|
||||
|
||||
export const dockerSettingsTemplate: DockerSettingsForm = {
|
||||
|
|
Loading…
Reference in a new issue