marklagendijk / jquery.tabbable

Simple utility for selecting the next / previous ':tabbable' element.
MIT License
47 stars 27 forks source link

consider the tabindex #8

Open rghiglianovich opened 8 years ago

rghiglianovich commented 8 years ago

the tab order should be given by the tabindex attribute, if present; so the selectable array should be ordered. something like this:

function selectNextTabbableOrFocusable(selector){
        var selectables = $(selector);
        selectables.sort(function(a, b){
            var a1=$(a).attr('tabindex')||0;
            var b1=$(b).attr('tabindex')||0;
            return a1-b1;

        } );
 ..... etcetera

RIc