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

259
Visualizações
React native - Click not trigger on button when an input is focused

I'm currently building a React native mobile app on Android, and I realized that when an input is focused (for the user to type something on his keyboard), the click event doesn't apply on other elements.

For instance, when the user is typing something in an input, then if the user want to click on "Submit button", then the click event only unfocus the input but doesn't trigger the click event on the button.

Is there a way to make both event happen when an input is focused ? (Unfocus and click on element both triggered, like in a webpage)

I found only this topic that seems to be have a similar problem but not working for me or I'm using it wrong ? Any touch events not trigger when the TextInput is on focus

My code looks like something like that :

import React, {useState} from 'react'
import { ScrollView, TextInput, TouchableOpacity} from 'react-native'

export default function App(){

    return (

        <ScrollView
            keyboardShouldPersistTaps="always"
        >
            <TextInput
                placeholder="Here is the input to be focused"
            />
            <TouchableOpacity
                style={{
                    backgroundColor : "#03a9f4"
                }}
                onPress={()=>{
                    console.log("Click triggered !")
                }}
            >
                Submit form
            </TouchableOpacity>
        </ScrollView>

    )

}
about 4 years ago · Juan Pablo Isaza
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