From 779f0cc530b4ae5bc336adfd52b7baa0a675d210 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Tue, 26 Nov 2024 15:46:14 +1030 Subject: [PATCH] Allow turbo frame updates inside kpop modals --- Gemfile.lock | 2 +- app/javascript/kpop/controllers/frame_controller.js | 2 ++ katalyst-kpop.gemspec | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a5b8c2b..1f869ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - katalyst-kpop (3.2.3) + katalyst-kpop (3.2.4) katalyst-html-attributes turbo-rails view_component diff --git a/app/javascript/kpop/controllers/frame_controller.js b/app/javascript/kpop/controllers/frame_controller.js index 898f10f..35688ac 100644 --- a/app/javascript/kpop/controllers/frame_controller.js +++ b/app/javascript/kpop/controllers/frame_controller.js @@ -118,6 +118,8 @@ export default class Kpop__FrameController extends Controller { beforeFrameRender(event) { this.debug("before-frame-render", event.detail.newFrame.baseURI); + if (event.detail.newFrame.id !== this.element.id) return; + event.preventDefault(); this.dismiss({ animate: true, reason: "before-frame-render" }).then(() => { diff --git a/katalyst-kpop.gemspec b/katalyst-kpop.gemspec index c04f79f..2c68c72 100644 --- a/katalyst-kpop.gemspec +++ b/katalyst-kpop.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "katalyst-kpop" - spec.version = "3.2.3" + spec.version = "3.2.4" spec.authors = ["Katalyst Interactive"] spec.email = ["developers@katalyst.com.au"]