feat(ProjectFinder): auto focus search bar

This commit is contained in:
Jordan Knott 2021-01-05 19:04:47 -06:00
parent edc7b649ec
commit be7e945313

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import styled from 'styled-components/macro'; import styled from 'styled-components/macro';
import { useGetProjectsQuery } from 'shared/generated/graphql'; import { useGetProjectsQuery } from 'shared/generated/graphql';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
@ -185,6 +185,7 @@ const ProjectFinder = () => {
return ( return (
<> <>
<Search <Search
autoFocus
variant="alternate" variant="alternate"
value={search} value={search}
onChange={e => setSearch(e.currentTarget.value)} onChange={e => setSearch(e.currentTarget.value)}