Fix linting in TextInput

This commit is contained in:
Mike Lonergan 2026-03-23 14:20:40 -07:00 committed by Mark McDowall
parent 947cc00647
commit 278ac98ed1
No known key found for this signature in database

View file

@ -2,8 +2,8 @@ import classNames from 'classnames';
import React, {
ChangeEvent,
FocusEvent,
SyntheticEvent,
forwardRef,
SyntheticEvent,
useCallback,
useEffect,
useImperativeHandle,
@ -46,7 +46,7 @@ export interface TextInputHandle {
}
const TextInput = forwardRef<TextInputHandle, TextInputProps | FileInputProps>(
function TextInput(
(
{
className = styles.input,
type = 'text',
@ -68,12 +68,16 @@ const TextInput = forwardRef<TextInputHandle, TextInputProps | FileInputProps>(
onSelectionChange,
}: TextInputProps | FileInputProps,
ref
) {
) => {
const inputRef = useRef<HTMLInputElement>(null);
useImperativeHandle(ref, () => ({
focus: () => inputRef.current?.focus(),
}), []);
useImperativeHandle(
ref,
() => ({
focus: () => inputRef.current?.focus(),
}),
[]
);
const selectionTimeout = useRef<ReturnType<typeof setTimeout>>();
const selectionStart = useRef<number | null>();