Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

267
Vistas
How to change cursor position when press in TextInput

For example i have a TextInput like this

<ScrollView style={{flex: 1}}>
      <TextInput
        placeholder="Input"
        style={{fontSize: 50}}
        value={'Sample text'}
      />
</ScrollView>

So normally, when we click on the TextInput, it will automatic show caret at the end of text ( on android ), no matter where we click, at the first time, it will have the caret at the end, like this

enter image description here

BUT HOW can we set the caret in where we click, for example when we click the "m" letter, it will have caret after the "m", like this

enter image description here

Problem is, as i said, on android we always have the the caret at the end first, then if we click other, the caret will more to that, like this

enter image description here

I mean, it not a problem when text is short, but imagine, the text will like this

enter image description here

And we want to edit some text that already exist, so it scroll all the way down to the bottom (because the bottom contain the lastest text)

So my question is

HOW CAN WE SET THE CARET ON WHERE WE TOUCH (OR CLICK), NOT FROM LASTEST WORD IN TEXTINPUT?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to request focus to this TextInput.

<TextInput
    placeholder="Input"
    autofocus={true}
    style={{fontSize: 50}}
    value={'Sample text'}
  />

Or if it will not be working, write this please https://github.com/react-native-modal/react-native-modal/issues/516

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda