Skip to content

Commit

Permalink
fix(NumberKeyboard): avoid Vue 2.6 event bubble issues (#5349)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Dec 22, 2019
1 parent e037082 commit c3685ac
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/number-keyboard/Key.js
Expand Up @@ -38,6 +38,10 @@ export default createComponent({
}
},

mounted() {
this.bindTouchEvent(this.$el);
},

methods: {
onTouchStart(event) {
// compatible with Vue 2.6 event bubble bug
Expand Down Expand Up @@ -65,15 +69,7 @@ export default createComponent({

render() {
return (
<i
role="button"
tabindex="0"
class={[BORDER, this.className]}
onTouchstart={this.onTouchStart}
onTouchmove={this.onTouchMove}
onTouchend={this.onTouchEnd}
onTouchcancel={this.onTouchEnd}
>
<i role="button" tabindex="0" class={[BORDER, this.className]}>
{this.slots('default') || this.text}
</i>
);
Expand Down

0 comments on commit c3685ac

Please sign in to comment.