Skip to content

Commit

Permalink
fix(components): disabled 属性依然会触发点击事件,close #6216
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche authored and Chen-jj committed May 7, 2020
1 parent 6914f54 commit 08ed9fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/taro-components/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export class Button implements ComponentInterface {

@Listen('touchstart')
onTouchStart () {
if (this.disabled) {
return
}

this.touch = true
if (this.hoverClass && !this.disabled) {
setTimeout(() => {
Expand All @@ -44,6 +48,10 @@ export class Button implements ComponentInterface {

@Listen('touchend')
onTouchEnd () {
if (this.disabled) {
return
}

this.touch = false
if (this.hoverClass && !this.disabled) {
setTimeout(() => {
Expand Down

0 comments on commit 08ed9fd

Please sign in to comment.