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

The v-checkbox doesn't generate checkbox ID #2119

Closed
cappe opened this issue Oct 10, 2017 · 0 comments
Closed

The v-checkbox doesn't generate checkbox ID #2119

cappe opened this issue Oct 10, 2017 · 0 comments
Labels
T: bug Functionality that does not work as intended/expected T: enhancement Functionality that enhances existing features
Milestone

Comments

@cappe
Copy link

cappe commented Oct 10, 2017

Steps to reproduce

  1. Create a v-checkbox with the following attributes:
    <v-checkbox id="checkbox-id" label="checkbox-label" v-model="checkbox" />

  2. Inspect the generated HTML:

<div tabindex="0" role="checkbox" aria-checked="false" aria-label="checkbox-label" class="input-group checkbox input-group--selection-controls">
  <label for="checkbox-id">checkbox-label</label>
  <div class="input-group__input">
    <i class="material-icons icon icon--selection-control" style="transform-origin: center top 0px;">check_box_outline_blank</i>
    <div class="input-group--selection-controls__ripple"></div>
  </div>
  <div class="input-group__details">
    <div class="input-group__messages"></div>
  </div>
</div>
  1. The ID "checkbox-id" is in the label's for-attribute but not in the checkbox itself. In the case of Vuetify the ID should be in <div class="input-group--selection-controls__ripple"></div> since if it is clicked via code ($('.input-group--selection-controls__ripple').click()), the checkbox gets checked/unchecked.

Versions

Tested with the following versions:
Vue: 2.4.2 and 2.4.4
Vuetify: 0.16.1 and 0.16.5

What is expected ?

The label's for-attribute should target the actual checkbox element, or in the case of Vuetify, the element that looks like a checkbox. This would allow:

  • doing checkbox clicks programmatically (by clicking the checkbox rather than the label)
  • using browser automated testing tools such as Nightwatch.js. to target the checkboxes directly rather than using some shady selectors.

What is actually happening ?

The checkbox ID doesn't get generated anywhere, rendering the label's for-attribute useless.

Reproduction Link

Codepen

@nekosaur nekosaur added the pending review The issue is still pending disposition label Oct 10, 2017
@johnleider johnleider added T: bug Functionality that does not work as intended/expected T: enhancement Functionality that enhances existing features and removed pending review The issue is still pending disposition labels Oct 11, 2017
@johnleider johnleider added this to the v1.1.0 milestone Oct 11, 2017
@johnleider johnleider mentioned this issue Apr 30, 2018
42 tasks
johnleider added a commit that referenced this issue Apr 30, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: bug Functionality that does not work as intended/expected T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

3 participants