Skip to content

Commit

Permalink
Merge pull request #43 from BeAPI/release/1.5.3
Browse files Browse the repository at this point in the history
Release/1.5.3
  • Loading branch information
firestar300 authored Mar 21, 2024
2 parents cbea4a3 + 9c1cfa2 commit b1ae105
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit b1ae105

Please sign in to comment.