Skip to content

Commit

Permalink
fix: ios fix for wrong layout
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Oct 27, 2020
1 parent 0ce2898 commit d422055
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,15 @@ export class Drawer extends GridLayout {
this.viewWidth[side] = width;
const data = this.computeTranslationData(side, width);
this.translationX[side] = width;
this.applyTrData(data, side);
// delay applyTrData or it will create a layout issue on iOS
setTimeout(() => this.applyTrData(data, side), 0);
} else {
const shown = this.viewWidth[side] - this.translationX[side];
this.viewWidth[side] = width;
const data = this.computeTranslationData(side, width - shown);
this.translationX[side] = width - shown;
this.applyTrData(data, side);
// delay applyTrData or it will create a layout issue on iOS
setTimeout(() => this.applyTrData(data, side), 0);
}
}

Expand Down

0 comments on commit d422055

Please sign in to comment.