Skip to content

Commit 11c6545

Browse files
committed
Release v2.2.3
1 parent 9a4dcbf commit 11c6545

File tree

8 files changed

+36
-44
lines changed

8 files changed

+36
-44
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9-
[Unreleased]: https://github.com/fylgja/alpinejs-dialog/compare/v2.2.2...HEAD
9+
[Unreleased]: https://github.com/fylgja/alpinejs-dialog/compare/v2.2.3...HEAD
10+
11+
## [2.2.3] - 2025-10-16
12+
[2.2.3]: https://github.com/fylgja/alpinejs-dialog/compare/v2.2.2...v2.2.3
13+
14+
### Fixed
15+
16+
- Missing closeBy logic for escape key event
1017

1118
## [2.2.2] - 2025-10-16
1219
[2.2.2]: https://github.com/fylgja/alpinejs-dialog/compare/v2.2.1...v2.2.2
1320

1421
### Fixed
1522

16-
- Escape key still triggering the native close event.
23+
- Escape key still triggering the native close event
1724

1825
## [2.2.1] - 2025-10-09
1926
[2.2.1]: https://github.com/fylgja/alpinejs-dialog/compare/v2.2.0...v2.2.1

dist/index.cjs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ function dialog_default(Alpine) {
5151
}
5252
}
5353
function escapeDialog(event) {
54-
if (event.key !== "Escape")
55-
return;
54+
if (event.key !== "Escape") return;
5655
event.preventDefault();
56+
if (closeBy === "none") return;
5757
evaluate();
5858
}
5959
function handleCloseByEvent(event) {
60-
if (event.target !== el)
61-
return;
60+
if (event.target !== el) return;
6261
const rect = el.getBoundingClientRect();
6362
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
6463
if (!isInDialog) {
@@ -74,14 +73,12 @@ function dialog_default(Alpine) {
7473
evaluate();
7574
}
7675
function open() {
77-
if (el.hasAttribute("open"))
78-
return;
76+
if (el.hasAttribute("open")) return;
7977
el.showModal();
8078
scrollLock(lockPageScroll);
8179
}
8280
function close() {
83-
if (!el.hasAttribute("open"))
84-
return;
81+
if (!el.hasAttribute("open")) return;
8582
el.close();
8683
scrollLock(false);
8784
}
@@ -101,11 +98,9 @@ function dialog_default(Alpine) {
10198
}
10299
}
103100
function modifierValue(modifiers, key, fallback) {
104-
if (modifiers.indexOf(key) === -1)
105-
return fallback;
101+
if (modifiers.indexOf(key) === -1) return fallback;
106102
const rawValue = modifiers[modifiers.indexOf(key) + 1];
107-
if (!rawValue)
108-
return fallback;
103+
if (!rawValue) return fallback;
109104
if (key === "closeby") {
110105
const allowedValues = ["auto", "none", "closerequest", "any"];
111106
const options = allowedValues.join(", ");
@@ -121,5 +116,3 @@ function modifierValue(modifiers, key, fallback) {
121116

122117
// src/module.js
123118
var module_default = dialog_default;
124-
// Annotate the CommonJS export names for ESM import in node:
125-
0 && (module.exports = {});

dist/index.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
}
2727
}
2828
function escapeDialog(event) {
29-
if (event.key !== "Escape")
30-
return;
29+
if (event.key !== "Escape") return;
3130
event.preventDefault();
31+
if (closeBy === "none") return;
3232
evaluate();
3333
}
3434
function handleCloseByEvent(event) {
35-
if (event.target !== el)
36-
return;
35+
if (event.target !== el) return;
3736
const rect = el.getBoundingClientRect();
3837
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
3938
if (!isInDialog) {
@@ -49,14 +48,12 @@
4948
evaluate();
5049
}
5150
function open() {
52-
if (el.hasAttribute("open"))
53-
return;
51+
if (el.hasAttribute("open")) return;
5452
el.showModal();
5553
scrollLock(lockPageScroll);
5654
}
5755
function close() {
58-
if (!el.hasAttribute("open"))
59-
return;
56+
if (!el.hasAttribute("open")) return;
6057
el.close();
6158
scrollLock(false);
6259
}
@@ -76,11 +73,9 @@
7673
}
7774
}
7875
function modifierValue(modifiers, key, fallback) {
79-
if (modifiers.indexOf(key) === -1)
80-
return fallback;
76+
if (modifiers.indexOf(key) === -1) return fallback;
8177
const rawValue = modifiers[modifiers.indexOf(key) + 1];
82-
if (!rawValue)
83-
return fallback;
78+
if (!rawValue) return fallback;
8479
if (key === "closeby") {
8580
const allowedValues = ["auto", "none", "closerequest", "any"];
8681
const options = allowedValues.join(", ");

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.mjs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ function dialog_default(Alpine) {
2525
}
2626
}
2727
function escapeDialog(event) {
28-
if (event.key !== "Escape")
29-
return;
28+
if (event.key !== "Escape") return;
3029
event.preventDefault();
30+
if (closeBy === "none") return;
3131
evaluate();
3232
}
3333
function handleCloseByEvent(event) {
34-
if (event.target !== el)
35-
return;
34+
if (event.target !== el) return;
3635
const rect = el.getBoundingClientRect();
3736
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
3837
if (!isInDialog) {
@@ -48,14 +47,12 @@ function dialog_default(Alpine) {
4847
evaluate();
4948
}
5049
function open() {
51-
if (el.hasAttribute("open"))
52-
return;
50+
if (el.hasAttribute("open")) return;
5351
el.showModal();
5452
scrollLock(lockPageScroll);
5553
}
5654
function close() {
57-
if (!el.hasAttribute("open"))
58-
return;
55+
if (!el.hasAttribute("open")) return;
5956
el.close();
6057
scrollLock(false);
6158
}
@@ -75,11 +72,9 @@ function dialog_default(Alpine) {
7572
}
7673
}
7774
function modifierValue(modifiers, key, fallback) {
78-
if (modifiers.indexOf(key) === -1)
79-
return fallback;
75+
if (modifiers.indexOf(key) === -1) return fallback;
8076
const rawValue = modifiers[modifiers.indexOf(key) + 1];
81-
if (!rawValue)
82-
return fallback;
77+
if (!rawValue) return fallback;
8378
if (key === "closeby") {
8479
const allowedValues = ["auto", "none", "closerequest", "any"];
8580
const options = allowedValues.join(", ");

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fylgja/alpinejs-dialog",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "Bring the power of AlpineJs to the HTML dialog",
55
"homepage": "https://fylgja.dev/",
66
"author": "Fylgja",

src/dialog.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default function (Alpine) {
5151
function escapeDialog(event) {
5252
if (event.key !== "Escape") return;
5353
event.preventDefault();
54+
55+
if (closeBy === "none") return;
5456
evaluate();
5557
}
5658

0 commit comments

Comments
 (0)