Skip to content

Commit

Permalink
revert "fix(VCheckbox): add for attribute on checkbox's related lab…
Browse files Browse the repository at this point in the history
…el (#6179)"

This reverts commit 86077df.
  • Loading branch information
johnleider committed Feb 4, 2019
1 parent f19a207 commit 666e0fc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
6 changes: 1 addition & 5 deletions packages/vuetify/src/components/VInput/VInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ export default mixins<options &
height: [Number, String],
hideDetails: Boolean,
hint: String,
id: {
type: String,
required: false
},
label: String,
loading: Boolean,
persistentHint: Boolean,
Expand Down Expand Up @@ -231,7 +227,7 @@ export default mixins<options &
color: this.validationState,
dark: this.dark,
focused: this.hasState,
for: this.$attrs.id || this.id,
for: this.$attrs.id,
light: this.light
}
}, this.$slots.label || this.label)
Expand Down
25 changes: 0 additions & 25 deletions packages/vuetify/test/unit/components/VCheckbox/VCheckbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,29 +367,4 @@ test('VCheckbox.js', ({ mount }) => {

expect(input.html()).toMatchSnapshot()
})

it('should add `for` attribute to label', () => {
const wrapper = mount(VCheckbox, {
attachToDocument: true,
propsData: {
id: 'foo',
label: 'bar'
}
})

const label = wrapper.first('.v-label')

expect(label.element.getAttribute('for')).toBe('foo')

const wrapper2 = mount(VCheckbox, {
attachToDocument: true,
propsData: {
label: 'bar'
}
})

const label2 = wrapper2.first('.v-label')

expect(label2.element.getAttribute('for')).toBe(null)
})
})

0 comments on commit 666e0fc

Please sign in to comment.