question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autoFocus does not work on Safari mobile

See original GitHub issue

autoFocus does not work on Safari mobile. The input shows the “focus” state, but the caret is not shown, which means that the <input> is not actually in focus so the keyboard is not shown.

https://codesandbox.io/s/93pz9n63py

Chrome - focused ✔️

2019-04-04 18 13 38

Safari - Mac - focused ✔️

2019-04-04 18 15 26

Safari - Mobile - Not actually in focus ❗️

2019-04-04 18 14 08

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

11reactions
Rall3ncommented, Sep 27, 2019

@karlingen Yes, we have. There was a comment about it in a ticket for WebKit. The comment was created March 2019, and states the following:

“We (Apple) like the current behavior and do not want programmatic focus to bring up the keyboard when […] the programmatic focus was not invoked in response to a user gesture.”

Source

3reactions
Rall3ncommented, Apr 9, 2019

Yes, mobile safari. I have edited my answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Sort of) Fixing autofocus in iOS Safari | by Tommy Brunn
We can't fully emulate the autofocus behavior, but we can get pretty close. Focusing a field does three things: Set focus styles; Scroll...
Read more >
Mobile Safari Autofocus text field - Stack Overflow
Mobile Safari has some focus problems. For example, you can't apply focus to a field via an onload event of the body. I'm...
Read more >
[SOLVED] Auto-focus text field in Safari - Wisej.com
While Chrome automatically selects the text field, I can't get it to work on Safari. I've tried calling .Focus in the form Load()...
Read more >
Autofocus attribute | Can I use... Support tables for ... - CanIUse
Autofocus attribute. - LS. Allows a form field to be immediately focused on page load. Usage % of. all users, all tracked, tracked...
Read more >
Input TextField AutoFocus issue | Apple Developer Forums
The problem has been faced on website when get visited from iPhone. Input Text Field is not getting autofocus on iOS devices though...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found