Skip to content

Commit e592ce8

Browse files
committed
Release v1.1.25
1 parent 3eaaa41 commit e592ce8

10 files changed

+78
-23
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@ When `:debug_heex_annotations` is enabled, LiveView will now annotate the beginn
267267

268268
To enable this, a new callback called `annotate_slot/4` was added. Custom implementations of `Phoenix.LiveView.TagEngine` must implement it accordingly.
269269

270+
## v1.1.25 (2026-02-26)
271+
272+
### Bug fixes
273+
274+
* Fix `phx-click-away` when clicked element is teleported ([#4141](https://github.com/phoenixframework/phoenix_live_view/issues/4141))
275+
* Handle `phx-hook` outside of LiveViews when reconnecting ([#4147](https://github.com/phoenixframework/phoenix_live_view/issues/4147))
276+
270277
## v1.1.24 (2026-02-16)
271278

272279
### Bug fixes

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Phoenix.LiveView.MixProject do
22
use Mix.Project
33

4-
@version "1.1.24"
4+
@version "1.1.25"
55

66
def project do
77
[

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": "phoenix_live_view",
3-
"version": "1.1.24",
3+
"version": "1.1.25",
44
"description": "The Phoenix LiveView JavaScript client.",
55
"license": "MIT",
66
"type": "module",

priv/static/phoenix_live_view.cjs.js

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

priv/static/phoenix_live_view.cjs.js.map

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

priv/static/phoenix_live_view.esm.js

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

priv/static/phoenix_live_view.esm.js.map

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

priv/static/phoenix_live_view.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3887,6 +3887,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
38873887

38883888
// js/phoenix_live_view/view_hook.ts
38893889
var HOOK_ID = "hookId";
3890+
var DEAD_HOOK = "deadHook";
38903891
var viewHookID = 1;
38913892
var ViewHook = class _ViewHook {
38923893
get liveSocket() {
@@ -3898,12 +3899,18 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
38983899
static elementID(el) {
38993900
return dom_default.private(el, HOOK_ID);
39003901
}
3902+
static deadHook(el) {
3903+
return dom_default.private(el, DEAD_HOOK) === true;
3904+
}
39013905
constructor(view, el, callbacks) {
39023906
this.el = el;
39033907
this.__attachView(view);
39043908
this.__listeners = /* @__PURE__ */ new Set();
39053909
this.__isDisconnected = false;
39063910
dom_default.putPrivate(this.el, HOOK_ID, _ViewHook.makeID());
3911+
if (view && view.isDead) {
3912+
dom_default.putPrivate(this.el, DEAD_HOOK, true);
3913+
}
39073914
if (callbacks) {
39083915
const protectedProps = /* @__PURE__ */ new Set([
39093916
"el",
@@ -4809,6 +4816,9 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
48094816
return;
48104817
}
48114818
if (hookElId && !this.viewHooks[hookElId]) {
4819+
if (ViewHook.deadHook(el)) {
4820+
return;
4821+
}
48124822
const hook = dom_default.getCustomElHook(el) || logError(`no hook found for custom element: ${el.id}`);
48134823
this.viewHooks[hookElId] = hook;
48144824
hook.__attachView(this);
@@ -5940,7 +5950,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
59405950
}
59415951
// public
59425952
version() {
5943-
return "1.1.24";
5953+
return "1.1.25";
59445954
}
59455955
isProfileEnabled() {
59465956
return this.sessionStorage.getItem(PHX_LV_PROFILE) === "true";
@@ -6547,12 +6557,18 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
65476557
}
65486558
dispatchClickAway(e, clickStartedAt) {
65496559
const phxClickAway = this.binding("click-away");
6560+
const portal = clickStartedAt.closest(`[${PHX_TELEPORTED_SRC}]`);
6561+
const portalStartedAt = portal && dom_default.byId(portal.getAttribute(PHX_TELEPORTED_SRC));
65506562
dom_default.all(document, `[${phxClickAway}]`, (el) => {
6551-
if (!(el.isSameNode(clickStartedAt) || el.contains(clickStartedAt) || // When clicking a link with custom method,
6563+
let startedAt = clickStartedAt;
6564+
if (portal && !portal.contains(el)) {
6565+
startedAt = portalStartedAt;
6566+
}
6567+
if (!(el.isSameNode(startedAt) || el.contains(startedAt) || // When clicking a link with custom method,
65526568
// phoenix_html triggers a click on a submit button
65536569
// of a hidden form appended to the body. For such cases
65546570
// where the clicked target is hidden, we skip click-away.
6555-
!js_default.isVisible(clickStartedAt))) {
6571+
!js_default.isVisible(startedAt))) {
65566572
this.withinOwners(el, (view) => {
65576573
const phxEvent = el.getAttribute(phxClickAway);
65586574
if (js_default.isVisible(el) && js_default.isInViewport(el)) {

0 commit comments

Comments
 (0)