Unable to remove Autofocus in ui-dialog

Josh picture Josh · Mar 22, 2012 · Viewed 19.6k times · Source

The first element in my jQuery UI Dialog is an input, which when selected opens a datepicker...

How can I disable this input from being selected first?

Answer

LaXDragon picture LaXDragon · Aug 16, 2013

Add the following code before you call dialog. This will clear out the autofocus code. It works for me in jquery 2.0.3.

$.ui.dialog.prototype._focusTabbable = function(){};