mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Fix linting in TextInput
This commit is contained in:
parent
947cc00647
commit
278ac98ed1
1 changed files with 10 additions and 6 deletions
|
|
@ -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>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue