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

194
Visualizações
Scrolling to a specific element on focus, when the keyboard opens, in a webview on android

I'm working on a React Native application that displays a website in a webview, the website is also under my control.

When the user focuses a specific text input inside the webview, I use window.scrollTo to scroll the user so that the TextInput is near the top of their screen. However, of course on mobile, when a user focuses a text input, it also often opens their soft input.

On Android (the only platform I've tested and am targeting), this causes the entire window to resize. Unfortunately, this causes my scroll to be canceled. I'd like that to not be the case.

So far I've tried scrolling after a timeout of about 200ms, but it's way too inconsistent and I'm not comfortable with the solution. I've also tried setting my RN activity's softInputMode to adjustPan, adjustResize, and adjustNothing, none of which seem to prevent the webview from resizing when the soft input is opened.

How can I:

  • Either prevent the window from resizing when the soft input is opened or
  • Reliably scroll to a specific position even when the window resizes?
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