Open GoogleCodeExporter opened 8 years ago
Line 104 to 108:
sbHolder = $("<div>", {
"id": "sbHolder_" + inst.uid,
"class": inst.settings.classHolder,
"tabindex": $target.attr("tabindex")
});
A tabindex attribute is added to the div.
Line 269 to 286:
case 9: //Tab
if (trgt) {
var inst = self._getInst(trgt);
if (inst/* && inst.isOpen*/) {
if ($f.length > 0) {
self._changeSelectbox(trgt, $f.attr("rel"), $f.text());
}
self._closeSelectbox(trgt);
}
}
var i = parseInt($this.attr("tabindex"), 10);
if (!e.shiftKey) {
i++;
} else {
i--;
}
$("*[tabindex='" + i + "']").focus();
break;
Here the tabindex is looked up and jQuery forces the next element with an
incremental tabindex to be focused.
I don't fully understand this. The next form element or sbHolder element should
be the element focused on.
Original comment by adamso...@gmail.com
on 23 Sep 2012 at 6:20
I removed:
var i = parseInt($this.attr("tabindex"), 10);
if (!e.shiftKey) {
i++;
} else {
i--;
}
$("*[tabindex='" + i + "']").focus();
and added this instead:
var focusables = $("input:focusable, .sbHolder");
var index = focusables.index(this);
var current = !e.shiftKey ? index+1 : index-1;
next = focusables.eq(current).length ? focusables.eq(current) :
focusables.eq(0);
next.focus();
It works fine except that focus is not triggered when the SHIFT -- TAB keys are
hit together.
Original comment by adamso...@gmail.com
on 23 Sep 2012 at 8:03
Attachments:
Original issue reported on code.google.com by
phec...@gmail.com
on 4 Jun 2012 at 3:58