Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoFocus does not work on Safari mobile #3501

Closed
csantos1113 opened this issue Apr 4, 2019 · 11 comments
Closed

autoFocus does not work on Safari mobile #3501

csantos1113 opened this issue Apr 4, 2019 · 11 comments

Comments

@csantos1113
Copy link

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

@Rall3n
Copy link
Collaborator

Rall3n commented Apr 8, 2019

@csantos1113 Mobile Safari does not allow "real" focus without user interaction. With "real" focus I mean it sets the focused state so the focus events are called, but input is not allowed.

@csantos1113
Copy link
Author

@Rall3n - you mean Safari mobile? because it works perfectly fine on "Safari - Mac"

@Rall3n
Copy link
Collaborator

Rall3n commented Apr 9, 2019

Yes, mobile safari. I have edited my answer.

@karlingen
Copy link

@Rall3n do we have an official answer from Apple confirming that statement or is this just something you have discovered?

@Rall3n
Copy link
Collaborator

Rall3n commented 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

@csantos1113
Copy link
Author

Closing in favor of Apple's decision. Nothing we can do

@pulkitaggarwal-nagarro-uf-srch

@Rall3n Autofocus is not working the first time but when we come back to the same page again, it's opening the keyboard by default. Is there any specific reason behind this?

@dipanshumahla
Copy link

@Rall3n Autofocus is not working the first time but when we come back to the same page again, it's opening the keyboard by default. Is there any specific reason behind this?

facing the same issue

@damianoc90
Copy link

@Rall3n Autofocus is not working the first time but when we come back to the same page again, it's opening the keyboard by default. Is there any specific reason behind this?

Same!

@Hyodori04
Copy link

i think caret is not active also .

@samrahsajid
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants