f887576a27
* Expose FilterInput from grafana/ui * Make table filter case insensitive * Update packages/grafana-ui/src/components/Table/FilterList.tsx Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com> Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com> Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
10 lines
262 B
TypeScript
10 lines
262 B
TypeScript
import { RefObject, useRef } from 'react';
|
|
|
|
export function useFocus(): [RefObject<HTMLInputElement>, () => void] {
|
|
const ref = useRef<HTMLInputElement>(null);
|
|
const setFocus = () => {
|
|
ref.current && ref.current.focus();
|
|
};
|
|
return [ref, setFocus];
|
|
}
|