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?
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?
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(){};
JQuery sets the autofocus on the first input that is found.
So play it sneaky by creating a "fake" input at the first line of your dialog like that:
<input type='text' size='1' style='position:relative;top:-500px;' />
So your input will be out of the window and have the focus. Problem solved for me ;p