GithubHelp home page GithubHelp logo

marklagendijk / jquery.tabbable Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 27.0 228 KB

Simple utility for selecting the next / previous ':tabbable' element.

License: MIT License

HTML 48.28% JavaScript 51.72%

jquery.tabbable's People

Contributors

khoden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jquery.tabbable's Issues

jquery-ui version

Hi, can you tell me from wich jquery-ui versión did you extract the ":tabbable" pseudoselector code?

Im using 1.7.1 and jQuery(":tabbable") return less elements (wrong behaviour) than yours repo's functions

Thanks

Some elements are incorrectly excluded in Chrome

In Chrome anchor elements which have sized children (ie: images) are not considered as visible or focusable, and therefore excluded.

This is caused by the difference in the way Chrome reports their offsetWidth and offsetHeight compared to other browsers (Chrome reports 0). This causes jQuery's expr.filters.hidden (":hidden") filter to consider it hidden, and the expr.filters.visible (":visible") filter is just a NOT of hidden.

Using http://api.jquery.com/category/version/1.5/ as a test page will reveal the problem on the books near the bottom. The selector below should get you the 3 elements in question

$("ul.books li a")

consider the tabindex

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

Find the next|previous focusable|tabbable elements

It'd be great if tabbable made it possible to see the focusable or tabbable element.

My use case is that I want to check to see if the next tabbable element is inside a form for accessiblity without actually going to the element.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.