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

id and label prop not working properly #15

Open
BayBreezy opened this issue May 26, 2023 · 0 comments
Open

id and label prop not working properly #15

BayBreezy opened this issue May 26, 2023 · 0 comments

Comments

@BayBreezy
Copy link

Hello,
Thanks for the package.
I found an issue where assigning an id to the toggle does not cause the value to switch upon clicking the label with the same for value.

Expected

To be able to assign an id to the component with value switch1 and add that same value to the for attribute of a label. Clicking on the label should toggle the state

What happened instead?

The state does not get updated

Reproduction

  • Add the package to a Vue or Nuxt app
<template>
     <Toggle id="s1" name="s1"
      v-model="value"
    ></Toggle>
    <label for="s1">Switch it up</label>
</template>

<script setup lang="ts">
import Toggle from "@vueform/toggle";
const value = ref(false);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant