Skip to content
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 4.1.9 - Released on 2025-09-24

### Features

- Added support for the `data-prismium-prevent` selector to prevent interaction with the accordion.

<br>

## 4.1.8 - Released on 2025-07-10

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prismium-src",
"version": "4.1.8",
"version": "4.1.9",
"description": "A modern JavaScript accordion library with smooth animations. Easily integrates with React, Vue, and vanilla JavaScript.",
"type": "module",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions src/core/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ class Prismium {
if (this.$current && !this.$current._hasClickHandler) {
const handler = (event) => {
event.preventDefault();

const preventSelectors = Array.isArray(
this.options.preventSelectors
)
? this.options.preventSelectors
: [this.options.preventSelectors];
const isInPreventSelector = preventSelectors.some((selector) =>
event.target.closest(selector)
);
if (isInPreventSelector) return;

if (!this.destroyed) {
this.toggle(el, true);
}
Expand Down
1 change: 1 addition & 0 deletions src/core/options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default {
// NS
iconAttribute: 'data-prismium-icon',
containerSelectors: ['[data-prismium-container]'],
preventSelectors: ['[data-prismium-prevent]'],
currentSelector: '[data-prismium-current]',
contentSelector: '[data-prismium-content]',
hiddenSelector: '[data-prismium-hidden]',
Expand Down