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

257
Visualizações
Virtual keyboard does not appear when focusing textarea with JavaScript unless a physical touch has been done first (Huawei Android Google Chrome)

when I set focus on a textarea with textarea.focus(); it won't open the virtual keyboard, unless I execute a physical touch on the page before.

A) I open the page on my SmartPhone. The page simply contains this code:

<textarea id="textarea"  rows="5" cols="20">
test
</textarea>

Then I execute the following code:

textarea.focus();

-> The textarea has focus now, the cursor inside the textarea appears, but the virtual keyboard does not open.

B) I open the same page on my SmartPhone.

This time I touch the page on a random position (just not inside the textarea. The textarea at this point has no focus).

Then I also execute the same code:

textarea.focus();

-> The textarea has focus now, the cursor inside the textarea appears, BUT this time the virtual keyboard actually appears.

A synthetic touch, createt like this, also does not work:

// Create a synthetic click MouseEvent
  let evt = new MouseEvent("click", {
    bubbles: true,
    cancelable: true,
    view: window
  });

Can anyone help me?

Kind regards Robin

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