From 98648b83f8aa2bd5b6746597a805809e65839579 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Thu, 18 Jun 2026 00:11:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75138=20[hotwired?= =?UTF-8?q?=5F=5Fturbo]=20Fix=20morph=20attribute=20`mutationType`=20value?= =?UTF-8?q?s=20by=20@myabc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/hotwired__turbo/hotwired__turbo-tests.ts | 7 +++++++ types/hotwired__turbo/index.d.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/hotwired__turbo/hotwired__turbo-tests.ts b/types/hotwired__turbo/hotwired__turbo-tests.ts index 4bc74319abaabc..5e3f6a582d3f63 100644 --- a/types/hotwired__turbo/hotwired__turbo-tests.ts +++ b/types/hotwired__turbo/hotwired__turbo-tests.ts @@ -151,6 +151,13 @@ document.addEventListener("turbo:submit-end", function(event) { } }); +document.addEventListener("turbo:before-morph-attribute", function(event) { + // $ExpectType string + event.detail.attributeName; + // $ExpectType "update" | "remove" + event.detail.mutationType; +}); + // Test start() function start(); diff --git a/types/hotwired__turbo/index.d.ts b/types/hotwired__turbo/index.d.ts index bfd2d8a12449be..fa0c1ce206aec8 100644 --- a/types/hotwired__turbo/index.d.ts +++ b/types/hotwired__turbo/index.d.ts @@ -520,7 +520,7 @@ export type TurboMorphElementEvent = CustomEvent<{ export type TurboBeforeMorphAttributeEvent = CustomEvent<{ attributeName: string; - mutationType: "updated" | "removed"; + mutationType: "update" | "remove"; }>; export type TurboBeforeFrameMorphEvent = CustomEvent<{