Skip to content

Svelte 5: adding use:action to an element breaks event.stopPropagation() #10165

@minht11

Description

@minht11

Describe the bug

In code below, adding empty action on container prevents e.stopPropagation() from working on button.

<div
	use:action
	onclick={() => console.log('clicked container')}
	onkeydown={() => {}}
>
  Container with action
  <button
	onclick={() => {
		e.stopPropagation()
		console.log('clicked button')
}}
		>
    Button
  </button>
</div>

Reproduction

Svelte 5 not working

Svelte 4 working

Logs

No response

System Info

"svelte": "5.0.0-next.34",

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions