Skip to content

[Bug Report][4.0.1] v-switch: Next click event not fired if writable computed setter doesn't update the source of truth #22689

@yvangrdv

Description

@yvangrdv

Environment

Vuetify Version: 4.0.1
Vue Version: 3.5.29
OS: macOS 10.15 (current)

Steps to reproduce

  1. Create a v-switch with a v-model bound to a writable computed.
  2. In the set method of the computed, add a condition that prevents updating the original ref.
  3. Click the switch and cancel confirm. The switch stays in its original position (Correct).
  4. Click the switch again.

Expected Behavior

The second click should immediately trigger the set method of the computed property again.

Actual Behavior

When binding a v-switch to a writable computed property, if the set function logic decides not to update the underlying reactive state (the source of truth), the v-switch visually reflects the correct state (it doesn't toggle), but it seems to get stuck. The next immediate click on the switch does nothing and triggers no events. A second click is required to make it work again.

Reproduction Link

https://play.vuetifyjs.com/#...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions