Skip to content

Commit 793cb74

Browse files
authored
Merge pull request #19 from Visual-Regression-Tracker/42-filter-debounce
42 filter debounce
2 parents 962b285 + 0f26b21 commit 793cb74

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

package-lock.json

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"konva": "^4.2.2",
1313
"qs": "^6.9.4",
1414
"react": "^16.13.1",
15+
"react-debounce-input": "^3.2.2",
1516
"react-dom": "^16.13.1",
1617
"react-konva": "^16.13.0-0",
1718
"react-router-dom": "^5.1.2",

src/components/Filters.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
Button,
1010
} from "@material-ui/core";
1111
import { TestRun, TestVariation } from "../types";
12+
import { DebounceInput } from "react-debounce-input";
1213

1314
interface IProps {
1415
items: (TestRun | TestVariation)[];
@@ -64,10 +65,13 @@ const Filters: React.FunctionComponent<IProps> = ({
6465
<React.Fragment>
6566
<Grid container spacing={2} alignItems="flex-end">
6667
<Grid item xs>
67-
<TextField
68+
<DebounceInput
6869
fullWidth
6970
label="Name"
7071
value={query}
72+
element={TextField}
73+
minLength={2}
74+
debounceTimeout={300}
7175
onChange={(event) => setQuery(event?.target.value)}
7276
/>
7377
</Grid>

src/components/SkeletonList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const SkeletonList: React.FunctionComponent = () => {
77
return (
88
<React.Fragment>
99
{list.map((i) => (
10-
<Box p={0.5} key={i}>
10+
<Box p={0.2} key={i}>
1111
<Skeleton variant="rect" height={80} />
1212
</Box>
1313
))}

0 commit comments

Comments
 (0)