Skip to content

Checkbox onChange event called before value updated #291

@T-bond

Description

@T-bond

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

Checkbox event callbacks do not keep order.
Binding a change event handler after the value binding will call the change event before the value update event.
In plain Svelte order of attributes are kept.

Related: #277

In which browser(s) did the problem occur?

Microsoft Edge

Steps To Reproduce

See sample code:

<input type="checkbox" on:change={() => console.log('Svelte before change', val)} bind:checked={val} on:change={() => console.log('Svelte after change', val)} />
{val}
<Checkbox on:change={() => console.log('SvelteUI before change', val2)} bind:checked={val2} on:change={() => console.log('SvelteUI after change', val2)} />
{val2}

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Relevant Assets

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions