From 02546950bf4562c5c0a488982490eabfe2c14501 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sat, 14 Mar 2026 21:43:33 +0100 Subject: [PATCH] fix: use Alpine.js v3 API for reply button click handler Alpine v3 uses Alpine.$data(el) instead of el.__x.$data. The old v2 pattern silently failed, making Reply buttons non-functional. Confab-Link: http://localhost:8080/sessions/184584f4-67e1-485a-aba8-02ac34a600fe --- js/webmentions.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/js/webmentions.js b/js/webmentions.js index 0026be2..a6f8293 100644 --- a/js/webmentions.js +++ b/js/webmentions.js @@ -634,15 +634,12 @@ // Find the commentsSection Alpine component and call startReply var commentsEl = document.querySelector('[x-data*="commentsSection"]'); - if (commentsEl && commentsEl.__x) { - commentsEl.__x.$data.startReply(replyUrl, platform, replyUrl, syndicateTo); - commentsEl.scrollIntoView({ behavior: 'smooth', block: 'start' }); - } else if (window.Alpine) { - var evt = new CustomEvent('owner-reply', { - detail: { replyUrl: replyUrl, platform: platform, syndicateTo: syndicateTo }, - bubbles: true - }); - btn.dispatchEvent(evt); + if (commentsEl && window.Alpine) { + var data = Alpine.$data(commentsEl); + if (data && data.startReply) { + data.startReply(replyUrl, platform, replyUrl, syndicateTo); + commentsEl.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } } }); });