[jQuery] Dynamically setting tab index and .focus() problems

[jQuery] Dynamically setting tab index and .focus() problems


Hello,
I'm opening a dialog box using the jQuery UI dialog methods, this box
will display a form, and I would like to autofocus the first element.
I'm also modifying tabindex of the different form fields of this new
form in order to make them a lot higher than those of the original
page, and thus navigate through the form using only the tab key.
The issue is that I can correctly change tabindex values, and
correctly focus the first element but pressing tab will not focus the
next element in my newly added form but seems to act as I was focusing
the first "tabindexable" element of my original page.
I also note that manually focusing (ie. clicking) the element cause no
problem, new tab index order is respected.
Does anyone have a clue where it can came from ? Something seems to be
messed up in the tabindex order.
Tested on FF3, maybe the browser only update tabindex order on
"manual" focus and not when modifying attributes ?