Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
glitch in react native clipboard while typing anything into TextInput

is there anyway to handle the input text context menu or detect the paste event. whenever i'm using clipboard functionality it causes the glitch while typing anything because clipboard.getString() awaits each time typing anything into the textbox.

i'm allowing user to enter only 10 digits in the TextInput, if user copies numbers from somewhere and pasted into TextInput it trims the last two digits, i.e. phone number 70XXXXXXXX -> in this case if user copies number which does not have leading +91 or 91 or 0 it works okay, but if number is like this +9170XXXXXXXXXX in this case it trims the last 2 digits and in textInput and it enters like 9170XXXXXX while it should be pasted as 70XXXXXXXX. -> this case is handled but it causes the glitch everytime user types anyting it awaits to check for the clipboard data.

<TextInput
  value={this.state.value}
  keyboardType="numeric"
  maxLength={10}
  onChangeText={async (val) => {
    let clipData = await Clipboard.getString();
    if (clipData) {
      let replacedValue = clipData.replace(/ /g, "").slice(-10);
      Clipboard.setString("");
      this.setState("value", replacedValue);
    } else {
        this.setState("value", val);
    }
  }}
/>
about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda