Skip to content

Change event handler dynamically #3040

Closed
@astanet

Description

@astanet

Svelte 3 is really great work.

I want to change event handler dynamically.
So, I assigned anonymous function to a variable and set this variable to event handler.
But it doesn't works as I expect.
Please see this REPL.
https://svelte.dev/repl/e9cc2a6c4ad64cb997bb557e066a7696?version=3.5.1

I found some workaround, but it's annoying a bit.
Is this behavior correct?
Is there something I missed?

with many thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions