Code Monkey home page Code Monkey logo

Comments (3)

davidtheclark avatar davidtheclark commented on August 20, 2024

When an element has tabindex="-1 it's not tabbable

Yep, it's not tabbable. So I don't think it should be returned in an array of tabbable elements, which is the purpose of this library, right? Maybe this could be clarified if you'd elaborate on your use case?

from tabbable.

slafleche avatar slafleche commented on August 20, 2024

I'm using your library to help with web accessibility. My use case would be if you want to set the focus to another location, relative to an element with tabindex=-1. Other fields are dynamic, so I can't rely on a specific field. Knowing the relative location of that tabindex=-1 element to other tabbable elements helps to figure out where focus should go.

from tabbable.

davidtheclark avatar davidtheclark commented on August 20, 2024

@slafleche I think this might make more sense within your own code instead of in the library. Tabbable is not going to be able to know where to put your tabindex="-1" element within the ordered array it returns, because that element doesn't actually belong in the ordered array, right (because it's not part of the tab order)?

There are a variety of ways you might accomplish this. Two ideas come to mind that I might experiment with: you could create different tabbable arrays before and after your tabindex="-1" element; you could insert that element into the place you know it belongs in the array returned by tabbable.

from tabbable.

Related Issues (20)

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.