Skip to content

@click.prevent causes checkbox :checked property to not render #10282

@Meekohi

Description

@Meekohi

Version

2.6.10

Reproduction link

https://codepen.io/meekohi/pen/jjgezj

Steps to reproduce

Use @click.prevent= along with a :checked='booleanComponentProp' on a checkbox. Clicking the checkbox correctly updates all data, but the checkbox visually remains in whatever the original state was.

What is expected?

Checkbox should update based on the :checked property.

What is actually happening?

Checkbox does not update.


This bug did not exist in Vue 2.5.22 -- it seems like Vue 2.6 started relying on the native click event to change the state of the box for the simple case, but if the underlying property changes via some other mechanism (for example a prop updating) then the checkbox visual appearance gets out of sync with the underlying data.

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