Skip to content

Commit

Permalink
Name function more specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Dec 10, 2019
1 parent 8e4fa68 commit 1efb711
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export const MetricsExplorerMetrics = ({ options, onChange, fields, autoFocus =
const [shouldFocus, setShouldFocus] = useState(autoFocus);

// the EuiCombobox forwards the ref to an input element
const handleInputRef = useCallback(
(ref: HTMLInputElement | null) => {
if (ref && shouldFocus) {
ref.focus();
const autoFocusInputElement = useCallback(
(inputElement: HTMLInputElement | null) => {
if (inputElement && shouldFocus) {
inputElement.focus();
setShouldFocus(false);
}
},
Expand Down Expand Up @@ -81,7 +81,7 @@ export const MetricsExplorerMetrics = ({ options, onChange, fields, autoFocus =
selectedOptions={selectedOptions}
onChange={handleChange}
isClearable={true}
inputRef={handleInputRef}
inputRef={autoFocusInputElement}
/>
);
};

0 comments on commit 1efb711

Please sign in to comment.