[Bug Report][4.0.1] v-switch: Next click event not fired if writable computed setter doesn't update the source of truth
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 41k
- Forks
- 7.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 11
Description
Environment
Vuetify Version: 4.0.1
Vue Version: 3.5.29
OS: macOS 10.15 (current)
Steps to reproduce
- Create a v-switch with a v-model bound to a writable computed.
- In the set method of the computed, add a condition that prevents updating the original ref.
- Click the switch and cancel confirm. The switch stays in its original position (Correct).
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked reproduction with Vuetify 4.0.1 and tracing v-switch handling for a writable computed v-model whose setter does not update its source ref. Confirm the fix by ensuring the second immediate click invokes the computed setter again while the switch remains in its original state when the update is rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100