marklagendijk / jquery.tabbable

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

Adding options for disabling and enabling tabbable elements #2

Open FesterCluck opened 10 years ago

FesterCluck commented 10 years ago

These new functions are useful for disabling tabbing functionality behind modals, or in any other logical group.

One would either use this before creating a modal:

$.disableTabbing();

or if the element exists on the page:

$.disableTabbing({exclude: $(".modal")});

Either way, using this will return the page to normal:

$.enableTabbing();

It's important to note my changes update a core filter in jQuery, :hidden. It incorrectly includes inline elements with 0 offsetHeight & offsetWidth. I'm happy to resubmit without it, but in testing it seems core that it needs to be done. I've submitted a bug to jQuery on the matter.

Future updates: I'll likely teach tabIndexes[] to keep track of when the index doesn't actually exist as an attribute so it doesn't get added to elements which didn't have it previously.

FesterCluck commented 10 years ago

Added a file, changes to hidden. Debugger, oops.

FesterCluck commented 10 years ago

Issue with jQuery:

https://github.com/jquery/jquery/issues/1855

FesterCluck commented 7 years ago

@marklagendijk We had discussed via email regarding transferring this repo?