Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.5.3 #43

Merged
merged 5 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.5.3 - 2024-03-21

- Add `aria-expanded="false"` attribute to button on init and remove it on destroy for Toggle class.

## 1.5.2 - 2024-01-23

- Fix closed Modal focusable elements
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@beapi/be-a11y",
"version": "1.5.2",
"version": "1.5.3",
"type": "module",
"description": "Collection of usefull accessible components",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions src/classes/Toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class Toggle extends AbstractDomElement {

this.initialized = true

el.setAttribute('aria-expanded', 'false')

if (this.target) {
el.addEventListener('click', this._handleClick)
} else if (!this.target && onClick) {
Expand Down Expand Up @@ -113,6 +115,7 @@ class Toggle extends AbstractDomElement {
this.initialized = false

this.reset()
el.removeAttribute('aria-expanded')

if (onClick) {
el.removeEventListener('click', onClick)
Expand Down
Loading