Code Monkey home page Code Monkey logo

accessible-menu-bootstrap-5's Introduction

accessible-menu-bootstrap-5

Latest release License Jest tests GitHub CodeQL

A JavaScript library to help you generate WAI-ARIA accessible menus with in the DOM using Bootstrap 5.

This project is an extension of accessible-menu to allow out-of-the-box for Bootstrap 5 compatibility.

The supported menu types are:

Getting Started

Please follow the main project's documentation.

Installation

You can install Accessible Menu Bootstrap 5 into your project using NPM.

# latest stable
npm install accessible-menu-bootstrap-5

Using Accessible Menu from a CDN

You can use Accessible Menu Bootstrap 5 directly from a CDN via a script tag.

<script src="https://cdn.jsdelivr.net/npm/accessible-menu-bootstrap-5/dist/accessible-menu-bs5.iife.js"></script>

We use jsdelivr as the example, but you can use any cdn you prefer, such as unpkg. You can also download the files listed in the CDN and host them yourself if preferred.

Examples

The following codepens are available as examples of how to use accessible-menu-bootstrap-5:

Sponsors

Coldfront Labs Inc.

Versioning

This project uses Semantic Versioning 2.0.0 to keep track of releases.

For more detailed information about SemVer, please see the official documentation.

Contributing

If you're interested in contributing to the project, please read the Contribution Guidelines. Any and all contributions must follow these guidelines or they will not be accepted.

accessible-menu-bootstrap-5's People

Contributors

dependabot[bot] avatar nickdjm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

accessible-menu-bootstrap-5's Issues

Docs: Links to ARIA APG are incorrect

Summary

The links for navigation menubar and navigation treeview in the README.md take you to the the APG homepage, not their specific menus.

Solution

Correct the links so that they point to the correct locations.

Feat: Support accessible-menu 4.x

Related Issues

There have been a few breaking changes made in 4.x of accessible-menu. Need to make sure this works with the latest version.

Solution

  • Check/update error handling
  • Swap to vite?

Docs: Example "Two-level menu with toggle" not working

Thanks very much for providing this as open source! ๐Ÿ‘

Summary

I tried to setup the example Two-level menu with toggle in a Codepen, but I get

TypeError: Cannot read properties of null (reading 'addEventListener')
    at _baseMenu.js:881:25

Error results from .dom.link:

 _handleFocus() {
    this.elements.menuItems.forEach((menuItem, index) => {
      menuItem.dom.link.addEventListener("focus", () => {

I already changed this line from docs

const menu = new AccessibleMenu.Bootstrap5DisclosureMenu({

to

const menu = new AccessibleMenuBootstrap5.Bootstrap5DisclosureMenu({

initialize it correctly.

I load the bootstrap css and the following js in codepen:

https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.min.js
https://cdn.jsdelivr.net/npm/[email protected]/dist/accessible-menu-bs5.min.js

Live: Codepen Live
Editor: Codepen Editor

Is there something I missed? I'm not familiar with dom.link of elements?

Thanks in advance!

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.