From 0e56af6d946a2f40a57d81578cb204bbea05d562 Mon Sep 17 00:00:00 2001 From: caterstation Date: Wed, 30 Apr 2025 11:15:18 +0500 Subject: [PATCH] Removed clipboard usage --- index.tsx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/index.tsx b/index.tsx index 6c56ef8..7e3a0de 100644 --- a/index.tsx +++ b/index.tsx @@ -2,7 +2,7 @@ import { InputProps, OTPInputViewState } from '@twotalltotems/react-native-otp-input'; import React, { Component } from 'react' import { View, TextInput, TouchableWithoutFeedback, Keyboard, Platform, I18nManager, EmitterSubscription, } from 'react-native' -import Clipboard from '@react-native-community/clipboard'; +//import Clipboard from '@react-native-community/clipboard'; import styles from './styles' import { isAutoFillSupported } from './helpers/device' import { codeToArray } from './helpers/codeToArray' @@ -93,20 +93,20 @@ export default class OTPInputView extends Component { const { pinCount, onCodeFilled } = this.props const regexp = new RegExp(`^\\d{${pinCount}}$`) - Clipboard.getString().then(code => { - if (this.hasCheckedClipBoard && regexp.test(code) && (this.clipBoardCode !== code)) { - this.setState({ - digits: code.split(""), - }, () => { - this.blurAllFields() - this.notifyCodeChanged() - onCodeFilled && onCodeFilled(code) - }) - } - this.clipBoardCode = code - this.hasCheckedClipBoard = true - }).catch(() => { - }) + // Clipboard.getString().then(code => { + // if (this.hasCheckedClipBoard && regexp.test(code) && (this.clipBoardCode !== code)) { + // this.setState({ + // digits: code.split(""), + // }, () => { + // this.blurAllFields() + // this.notifyCodeChanged() + // onCodeFilled && onCodeFilled(code) + // }) + // } + // this.clipBoardCode = code + // this.hasCheckedClipBoard = true + // }).catch(() => { + // }) } private handleChangeText = (index: number, text: string) => {