Giter VIP home page Giter VIP logo

accordion's People

Contributors

dpetton avatar enwin avatar spone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

accordion's Issues

[Question] How to use for an "in-place toggle"?

Hi there, thank you for this very promising library! We are using it in an upcoming project.

I have a specific use case and I'm wondering if this library is a good fit for it:

I have this button:

image

that takes focus from keyboard:

image

When I click it (or press Return/Space), I want to "replace" it visually with the following buttons:

image
(initially the focus is kept on the original button)

then when I press Tab the first item in the content gets the focus:

image

I managed to implement this with:

button[aria-expanded="true"] > * {
  visibility: hidden;
}

and absolute positioning to make the content visible on top of the button.

I only have one issue: in Firefox the behavior is not the same if I press Space or Return while focusing the button. Return works as expected, but Space displays the content for a millisecond then hides it. It's probably a browser bug because accordion handles Space and Return the same way.

Do you think it's a proper use of the accordion script? Do you see any potential accessibilty issue in this implementation?

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.