diff --git a/CHANGELOG.md b/CHANGELOG.md index c2ae7c2..531d501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.6 - 2024-09-25 + +- Add condition to hidden class name for the modal component. + ## 1.5.5 - 2024-07-31 - Add `onTabChange` option callback for Tabs component diff --git a/package.json b/package.json index 6c00759..3982b57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@beapi/be-a11y", - "version": "1.5.5", + "version": "1.5.6", "type": "module", "description": "Collection of usefull accessible components", "repository": { diff --git a/src/classes/Modal.js b/src/classes/Modal.js index 3bbf393..6872c6a 100644 --- a/src/classes/Modal.js +++ b/src/classes/Modal.js @@ -65,7 +65,9 @@ class Modal extends AbstractDomElement { el.id = this.id } - el.classList.add(closedClassName) + if (el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true') { + el.classList.add(closedClassName) + } // Set aria-labelledby attribute if (labelSelector && el.querySelector(labelSelector)) {