Skip to content

Commit 68c5cec

Browse files
committed
chore(input): remove unused event listeners
1 parent 25e14b4 commit 68c5cec

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

packages/input-otp/src/input.tsx

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -537,51 +537,6 @@ export const OTPInput = React.forwardRef<HTMLInputElement, OTPInputProps>(
537537
_pasteListener(e)
538538
props.onPaste?.(e)
539539
}}
540-
onTouchEnd={e => {
541-
const isFocusing = document.activeElement === e.currentTarget
542-
if (isFocusing) {
543-
setTimeout(() => {
544-
_selectListener()
545-
}, 50)
546-
}
547-
548-
props.onTouchEnd?.(e)
549-
}}
550-
onTouchMove={e => {
551-
const isFocusing = document.activeElement === e.currentTarget
552-
if (isFocusing) {
553-
setTimeout(() => {
554-
_selectListener()
555-
}, 50)
556-
}
557-
558-
props.onTouchMove?.(e)
559-
}}
560-
onClick={e => {
561-
inputRef.current.__metadata__ = Object.assign(
562-
{},
563-
inputRef.current?.__metadata__,
564-
{ lastClickTimestamp: Date.now() },
565-
)
566-
567-
props.onClick?.(e)
568-
}}
569-
onDoubleClick={e => {
570-
const lastClickTimestamp =
571-
inputRef.current?.__metadata__?.lastClickTimestamp
572-
573-
const isFocusing = document.activeElement === e.currentTarget
574-
if (
575-
lastClickTimestamp !== undefined &&
576-
isFocusing &&
577-
Date.now() - lastClickTimestamp <= 300 // Fast enough click
578-
) {
579-
e.currentTarget.setSelectionRange(0, e.currentTarget.value.length)
580-
syncTimeouts(_selectListener)
581-
}
582-
583-
props.onDoubleClick?.(e)
584-
}}
585540
onInput={e => {
586541
syncTimeouts(_selectListener)
587542

0 commit comments

Comments
 (0)