Skip to content

Commit

Permalink
fix(taro-components): 修复Input 组件事件问题 close # 1647
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongxin committed Dec 26, 2018
1 parent 0b2096d commit 7b702e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/taro-components/src/components/input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ class Input extends Nerv.Component {
}

onInput (e) {
const { onChange = '' } = this.props
const { onInput = '', onChange = '' } = this.props
if (!this.isOnComposition) {
Object.defineProperty(e, 'detail', {
enumerable: true,
value: {
value: e.target.value
}
})
if (onChange) onChange && onChange(e)
if (onChange) return onChange && onChange(e)
if (onInput) return onInput && onInput(e)
}
}

Expand Down

0 comments on commit 7b702e7

Please sign in to comment.