Skip to content

Commit

Permalink
revert(VTextField): partial revert of #12554 (#12757)
Browse files Browse the repository at this point in the history
  • Loading branch information
MajesticPotatoe committed Dec 9, 2020
1 parent 41a86bd commit d2957b1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VInput/VInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default baseMixins.extend<options>().extend({
}, this.$slots.label || this.label)
},
genMessages () {
if (this.hideDetails === true) return null
if (!this.showDetails) return null

return this.$createElement(VMessages, {
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ describe('VInput.ts', () => {
},
})

expect(wrapper.html()).toMatchSnapshot()
expect(wrapper.vm.genMessages()).toBeNull()

wrapper.setProps({ error: true })
expect(wrapper.vm.genMessages()).not.toBeNull()
expect(wrapper.vm.genMessages()).toBeNull()

wrapper.setProps({ errorMessages: 'required' })
expect(wrapper.vm.genMessages()).not.toBeNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,6 @@ exports[`VInput.ts should generate append and prepend slots 2`] = `
</div>
`;

exports[`VInput.ts should hide messages if no messages and hide-details is auto 1`] = `
<div class="v-input v-input--hide-details theme--light">
<div class="v-input__control">
<div class="v-input__slot">
</div>
<div class="v-messages theme--light">
<span name="message-transition"
tag="div"
class="v-messages__wrapper"
>
</span>
</div>
</div>
</div>
`;

exports[`VInput.ts should not apply attrs to element 1`] = `
<div class="v-input theme--light">
<div class="v-input__control">
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VTextField/VTextField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export default baseMixins.extend<options>().extend({
})
},
genMessages () {
if (this.hideDetails === true) return null
if (!this.showDetails) return null

const messagesNode = VInput.options.methods.genMessages.call(this)
const counterNode = this.genCounter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ exports[`VTextField.ts should hide messages if no messages and hide-details is a
>
</div>
</div>
<div class="v-text-field__details">
<div class="v-messages theme--light">
<span name="message-transition"
tag="div"
class="v-messages__wrapper"
>
</span>
</div>
</div>
</div>
</div>
`;
Expand Down

0 comments on commit d2957b1

Please sign in to comment.