Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VCheckboxBtn): reset checked state when readonly is true #19861

Merged
merged 2 commits into from
May 29, 2024
Merged

fix(VCheckboxBtn): reset checked state when readonly is true #19861

merged 2 commits into from
May 29, 2024

Conversation

RafalOsieka
Copy link
Contributor

Description

fixes #19137

How to reproduce the bug is described in the referenced issue, but shortly, the input internal checked state was out of sync with modelValue when the readonly flag is true.

That caused the bug, when the checkbox becomes interactive again, and sometimes it would not update the model value on the first click on the checkbox.

Markup:

<template>
  <v-app>
    <v-container>
      <v-checkbox-btn
        label="Checkbox #1:"
        v-model="checkboxState"
        :readonly="shouldLockCheckboxUpdates"
      />

      <v-checkbox-btn
        v-model="shouldLockCheckboxUpdates"
        label="Checkbox #2:"
      />
    </v-container>
  </v-app>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const checkboxState = ref(false);
const shouldLockCheckboxUpdates = ref(false);
</script>

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VCheckboxBtn VCheckboxBtn labels May 27, 2024
@johnleider johnleider added this to the v3.6.x milestone May 29, 2024
@johnleider johnleider merged commit ed2f0fa into vuetifyjs:master May 29, 2024
10 checks passed
@RafalOsieka RafalOsieka deleted the fix/19137-not-interactive-input-invalid-state branch May 29, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VCheckboxBtn VCheckboxBtn T: bug Functionality that does not work as intended/expected
Projects
None yet
3 participants