From 2a467a38b4bd723af3e0d14bafc5950d02ead7bf Mon Sep 17 00:00:00 2001 From: Katja Potensky <785327-hesxenon@users.noreply.gitlab.com> Date: Tue, 20 Aug 2024 16:43:10 +0200 Subject: [PATCH 1/2] fix: don't set idl on custom elements that are interested in the corresponding content attribute --- src/diff/props.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diff/props.js b/src/diff/props.js index 316146f0fd..db8d4b849b 100644 --- a/src/diff/props.js +++ b/src/diff/props.js @@ -117,6 +117,7 @@ export function setProperty(dom, name, value, oldValue, namespace) { name != 'colSpan' && name != 'role' && name != 'popover' && + !dom.constructor.observedAttributes?.includes(name) && name in dom ) { try { From 5ca6c5277a4068f01465754dc8e533c30e2c3596 Mon Sep 17 00:00:00 2001 From: Katja Potensky <785327-hesxenon@users.noreply.gitlab.com> Date: Wed, 21 Aug 2024 09:52:17 +0200 Subject: [PATCH 2/2] fix(tests): tsc checks js code in toolchain - this fix can't be checked yet without incurring additional runtime cost --- src/diff/props.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/diff/props.js b/src/diff/props.js index db8d4b849b..7ca7b83cbe 100644 --- a/src/diff/props.js +++ b/src/diff/props.js @@ -117,6 +117,10 @@ export function setProperty(dom, name, value, oldValue, namespace) { name != 'colSpan' && name != 'role' && name != 'popover' && + // observedAttributes can exist as a static property on custom elements + // a runtime check here has no tangible benefit apart from satisfying typescript + // which runs later in the toolchain + // @ts-ignore !dom.constructor.observedAttributes?.includes(name) && name in dom ) {