Git Product home page Git Product logo

aria-dropdown's People

Contributors

davidetriso avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

aria-dropdown's Issues

Check behaviour of parent and nested dropdown

Currently nested dropdown works, but clicking inside the parent dropdown will not collapse any nested dropdown, even if collapseOnOutsideClick is set to true, because the parent elements prevents the default event. If a dropdown has mixed content (dropdowns and other controls), an expanded dropdown will not automatically collapse when other controls at the same nesting level are operated.
With the third level of nested dropdowns the plugin actually breaks with some specific options, and trying to expand the dropdown will instead lead to collapsing the parent dropdown.

Dropdown menu briefly shown on page load

Describe the bug
When the page hasn't fully loaded, the dropdown menu can be visible.

To Reproduce
Steps to reproduce the behavior:

  1. Load the demo page - https://davidetriso.github.io/aria-dropdown/
  2. You can view the menu for a split second or two.

Expected behavior
The dropdown menu should not be visible unless it has focus.

Additional context
I have the following CSS fix in a testing environment:

.dropdown__menu {
  /* hide offscreen for accessibility */
  position: absolute;
  left:-10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* show menu when expanded */
.dropdown__menu_expanded {
  left: auto;
  width: auto;
  height: auto;
  overflow: auto;
}

The "moving content offscreen" technique is from the WebAIM article - "Invisible Content Just for Screen Reader Users":
https://webaim.org/techniques/css/invisiblecontent/

I'm not sure if this is the proper technique for menus. CSS Tricks has the following article on dropdown menus:
https://css-tricks.com/solved-with-css-dropdown-menus/

They are using simply visibility: hidden and display: none. I don't necessarily think "display: none" is the best approach there. Would welcome your thoughts.

Also worth noting from the comments section of the CSSTricks article are the following attempts at addressing accessible dropdown menus:

Add method to prevent dropdown from opening on click

Could be useful to manage dropdown state with mouse enter and mouse out on desktop.
If mousernter event is detected, block click event until mouseout occurs. By doing this it will be possible to prevent dropdown from collapsing on click for users with mouse. At the same time, the click functionality is preserved for users without mouse, and the dropdown will also be operable on touch devices.

iOS window click is not triggered

iOS window click is not triggered, need to test on IE mobile and android

collapseOnOutsideClick has no effect on mobile iOS because no click event is fired when window is clicked.

Needs to implement touch events

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.