Skip to content

Commit

Permalink
fix(module: swipe-action): fix swipe-action not work in ionic bug (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
BronzeCui authored and fisherspy committed Sep 6, 2019
1 parent b0d4e8c commit f2d1600
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/swipe-action/swipe-action.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export class SwipeActionComponent implements OnInit, AfterViewInit, OnDestroy {
}

setBtnStyle(value) {
if (this._btnsLeftWidth === 0 || this._btnsRightWidth === 0) {
this._btnsLeftWidth = this.leftBtnRef ? this.leftBtnRef.nativeElement.offsetWidth : 0;
this._btnsRightWidth = this.rightBtnRef ? this.rightBtnRef.nativeElement.offsetWidth : 0;
}
const limit = value > 0 ? this._btnsLeftWidth : -this._btnsRightWidth;
const contentLeft = this.getContentEasing(value, limit);
this.content.nativeElement.style.left = `${contentLeft}px`;
Expand Down

0 comments on commit f2d1600

Please sign in to comment.