I have a dialog box designed like this:
<div id="choose_product" title="Choose a Product" style="display:none;">
<button id="sel_1">Prod. 1</button>
<button id="sel_2">Prod. 2</button>
</div>
with JS:
$('#choose_product').dialog({
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
buttons: {
Cancel: function(){
$(this).dialog("close");
}
}
});
When the dialog box opens up, the Prod 1 button is selected (highlighted) by default, I don't know why. You can see it on this JSFiddle. When you click RUN, you can see that the Prod. 1
button comes up selected by default. Does anyone know why this is happening? Is there something I am doing wrong?
Thanks!
** Edit **
In my application I actually use $('#choose_product').dialog("open");
to open the dialog. if you use $('#choose_product :button').blur();
right after that, then no buttons are selected by default. A slight work-around but seems to work.
See an updated fiddle.