From 9523c797a2b11685abbd520eb3c9b92a977ca15f Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 7 Jan 2025 17:46:15 +0100 Subject: [PATCH] docs: note custom elements on caveat closes #14727 --- documentation/docs/07-misc/04-custom-elements.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/docs/07-misc/04-custom-elements.md b/documentation/docs/07-misc/04-custom-elements.md index 71c66f7edce5..a8e0c8176316 100644 --- a/documentation/docs/07-misc/04-custom-elements.md +++ b/documentation/docs/07-misc/04-custom-elements.md @@ -125,3 +125,4 @@ Custom elements can be a useful way to package components for consumption in a n - The deprecated `let:` directive has no effect, because custom elements do not have a way to pass data to the parent component that fills the slot - Polyfills are required to support older browsers - You can use Svelte's context feature between regular Svelte components within a custom element, but you can't use them across custom elements. In other words, you can't use `setContext` on a parent custom element and read that with `getContext` in a child custom element. +- Don't declare properties or attributes starting with `on`, as their usage will be interpreted as an event listener. In other words, Svelte treats `` as `customElement.addEventListener('eworld', true)` (and not as `customElement.oneworld = true`)