mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
Plugins: automatically search plugins when typing in plugin list search box. (#36643)
* will automagically search if typing something in the search field. * Decreasing the debounced time to 500ms
This commit is contained in:
parent
11d03f7961
commit
a6872deeb9
@ -2,6 +2,7 @@ import React, { useState } from 'react';
|
||||
import { css } from '@emotion/css';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useDebounce } from 'react-use';
|
||||
|
||||
interface Props {
|
||||
value?: string;
|
||||
@ -12,6 +13,8 @@ export const SearchField = ({ value, onSearch }: Props) => {
|
||||
const [query, setQuery] = useState(value);
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
useDebounce(() => onSearch(query ?? ''), 500, [query]);
|
||||
|
||||
return (
|
||||
<input
|
||||
value={query}
|
||||
|
Loading…
Reference in New Issue
Block a user