Skip to content

Sveltekit filebase router uses anchor click events. So do not stop propagation of these events. #4347

@voscausa

Description

@voscausa

Describe the bug

I used a click event in a pulldown menu components of a NavBar to close the pulldown after a menu item was clicked.
The click handler in the pulldown menu component used stopPropagtion. Doing so the click event could not reach the filebased router and the browser took over.

This should in my opinion be clear in the docs.

Reproduction

Block the click bubble using stopPropagation of routing anchors

Logs

No response

System Info

Not applicable

Severity

annoyance

Additional Information

Took me a couple of hours to find out why the Svelkit router ignored the anchor click of items in the pulldown menu.
For the pulldown menu component I used code, which worked fine in a Svelte project using my own hash router.
But the Sveltekit file-based router uses clicks to route.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions