marklagendijk / jquery.tabbable Goto Github PK
View Code? Open in Web Editor NEWSimple utility for selecting the next / previous ':tabbable' element.
License: MIT License
Simple utility for selecting the next / previous ':tabbable' element.
License: MIT License
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.
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")
'focusable' function should iterate only over nodes.
Right now it reads <script>, and so on...
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
When $.tabNext(); focus the button it triggers the button click event automatically which is wrong.
So how to prevent button click ?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.