Skip to content

Conversation

@benjosua
Copy link

@benjosua benjosua commented Jan 20, 2026

Attempt to fix issue #17057 where handle_event_propagation breaks when delegated events are arrays instead of functions in custom elements.

Changes:

  1. Compiler: Don't delegate events in custom element builds
  2. Runtime: Handle both function and array delegates defensively

This prevents cross-version compatibility issues with custom elements.

Not a perfect solution. Is this the most practical path forward, or is there a cleaner approach that allows cross-version compatibility?

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2026

⚠️ No Changeset found

Latest commit: d6e70b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot
Copy link

Fixes issue where handle_event_propagation breaks when delegated events
are arrays instead of functions, which can happen in custom elements
used across different Svelte versions.

Changes:
1. Compiler: Don't delegate events in custom element builds
2. Runtime: Handle both function and array delegates defensively

This prevents cross-version compatibility issues with custom elements.
@benjosua benjosua force-pushed the fix-event-delegation-custom-elements branch 2 times, most recently from 1902ae3 to d6e70b6 Compare January 20, 2026 22:30
@benjosua benjosua marked this pull request as draft January 20, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant