• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

251
Views
keyboard doesn't open in ios on focus

I am currently developing the login aspect inside a custom browser on ios. I want to open the keyboard when a user clicks on an input element. When an input element gets clicked, I set the 'autofocus' attribute for that element, followed by a focus on the element. However, these steps are not sufficient for opening the keyboard. I have tried methods present in the link: IOS show keyboard on input focus, but nothing works. The software version I'm working with is 14.4.2.

I am testing the app on an iPad.

var ev = new MouseEvent('click', {
                                       'view': window,
                                       'bubbles': true,
                                       'cancelable': true,
                                       'screenX': x,
                                       'screenY': y
                                   });

//x and y are the screen coordinates of the point where a user clicks.
var el = document.elementFromPoint(x, y); 
console.log("Clicked element: "+el); //print element to console
                                   
el.addEventListener('click', function() {
                    el.setAttribute('autofocus', 'autofocus');
                    el.focus();
});
el.dispatchEvent(ev);
about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you are testing your app in Simulator , make sure I/O -> Keyboard -> Connect Hardware Keyboard is unchecked. Otherwise, you won't see the keyboard appear.

about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error