jQuery UI - Dialog - How to hide autofocus

The simplest way, just add hidden input with autofocus attribute.

<input type="hidden" autofocus>

As it said in jQuery UI documentation, it will find this input firstly by priority and move focus on this input. But as this input hidden user does not see this.

Choosing priority:

  • The first element with the autofocus attribute
  • The first :tabbable element within the dialog's content
  • The first :tabbable element within the dialog's buttonpane
  • The dialog's close button
  • The dialog itself

Comments

Popular posts from this blog

HTML - How to add placeholder to dropdown (select) with selectpicker

Git - How to revert, cancel last changes on remote server

Idea PhpStorm - How to fix bugs with incorrect code Inspections and Autocomplete