Skip to content

Commit 072bd1f

Browse files
committed
updating input focus, remove refs
1 parent cdab141 commit 072bd1f

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

dist/ccdb5.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ccdb5.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Filters/FilterSearch/FilterSearch.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import '../../Typeahead/Typeahead.scss';
2-
import { useEffect, useRef, useState } from 'react';
2+
import { useRef, useState } from 'react';
33
import { useDispatch } from 'react-redux';
44
import { Typeahead } from 'react-bootstrap-typeahead';
55
import { filterAdded } from '../../../actions';
@@ -12,7 +12,7 @@ import { HighlightingOption } from '../../Typeahead/HighlightingOption/Highlight
1212
import getIcon from '../../Common/Icon/iconMap';
1313

1414
export const FilterSearch = ({ fieldName }) => {
15-
const ref = useRef();
15+
const ref = useRef(null);
1616
const dispatch = useDispatch();
1717

1818
const fieldNameNew = fieldName.replace(/_/g, ' ');
@@ -95,11 +95,6 @@ export const FilterSearch = ({ fieldName }) => {
9595
handleClear();
9696
};
9797

98-
// give the input focus when the component renders the first time
99-
useEffect(() => {
100-
ref.current.focus();
101-
}, [ref]);
102-
10398
return (
10499
<div className="typeahead">
105100
<div className="o-search-input">

0 commit comments

Comments
 (0)