Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!