2

How to make auto focus of text field using javascript for ios safari browser.

I have used autofocus tag in html, its working for android but not for ios.

  • Possible duplicate of [Can't Set Focus in Safari](https://stackoverflow.com/questions/48547975/cant-set-focus-in-safari) – Devsi Odedra Aug 08 '19 at 13:26

1 Answers1

0

By now, IOS Safari does not allow this. Clearly, this does not work in IOS Safari by design.

Even the code in the duplicate does not help with the real answer to the problem. The user must first interact with the page before focus() can actually work.

There is no way to actually overcome the rule of focus() in Safari other than redeveloping the function itself which is unbelievably hard to do.

new Q Open Wid
  • 2,225
  • 2
  • 18
  • 34