Skip to content

Commit

Permalink
fix(VTextField): show correct deprecation notices for icon props
Browse files Browse the repository at this point in the history
see #4254
  • Loading branch information
KaelWD committed Jun 11, 2018
1 parent 2773c94 commit fcefbcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/components/VInput/VInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ export default {
this.$slots.default
]
},
genIcon (type, cb) {
// TODO: remove shouldDeprecate (2.0), used for clearIcon
genIcon (type, cb, shouldDeprecate = true) {
const icon = this[`${type}Icon`]
const eventName = `click:${type}`
cb = cb || this[`${type}IconCb`]

if (type) {
if (shouldDeprecate && type && cb) {
deprecate(`:${type}-icon-cb`, `@click:${type}`, this)
}

cb = cb || this[`${type}IconCb`]

const data = {
props: {
color: this.validationState,
Expand Down
6 changes: 4 additions & 2 deletions src/components/VTextField/VTextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ export default {
if (this.clearIconCb) deprecate(':clear-icon-cb', '@click:clear', this)

return this.genSlot('append', 'inner', [
this.genIcon(icon,
(this.$listeners['click:clear'] ? false : this.clearIconCb) || this.clearableCallback
this.genIcon(
icon,
(!this.$listeners['click:clear'] && this.clearIconCb) || this.clearableCallback,
false
)
])
},
Expand Down

0 comments on commit fcefbcb

Please sign in to comment.