From 40f44271df61952afc9762b75826a0444724aa5b Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Wed, 15 Oct 2025 13:46:07 +0200 Subject: [PATCH] Adopt the new `NudeElement` API --- src/common/color-element.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/color-element.js b/src/common/color-element.js index d34b15e..4af96f9 100644 --- a/src/common/color-element.js +++ b/src/common/color-element.js @@ -135,6 +135,13 @@ const Self = class ColorElement extends NudeElement { } } + // CRITICAL: Initialize the class BEFORE defining the custom element. + // This ensures mixins are applied and composed functions are created + // on the prototype before the browser caches references to lifecycle callbacks. + // Without this, the browser would register the unmodified inherited callbacks + // from parent classes instead of the composed versions created by mixins. + this.init(); + customElements.define(this.tagName, this); } };