Skip to content

listener added via use:ref.addEventListener is unstoppable by e.stopPropagation #15535

@andriuwe4ka

Description

@andriuwe4ka

Describe the bug

we have two nested elements

  • parent: add event listener for something (eg: click) through Action
  • child: add onsomething handler (eg: click)

expected behavior:
e.stopPropagation() in child's handler should prevent parent' listener execution

current behavior:
e.stopPropagation() does not affect anything
even more: parent' listener is activated prior to child' handler

Reproduction

https://svelte.dev/playground/864d939fbd80483482f4c6d7f0ea4d08?version=5.23.1

Logs

System Info

Chrome

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    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