diff --git a/src/Swipeout.tsx b/src/Swipeout.tsx index 88c6e00..b126a9e 100644 --- a/src/Swipeout.tsx +++ b/src/Swipeout.tsx @@ -52,8 +52,10 @@ export default class Swipeout extends React.Component { } componentDidMount() { - this.btnsLeftWidth = this.left ? this.left.offsetWidth : 0; - this.btnsRightWidth = this.right ? this.right.offsetWidth : 0; + setTimeout(() => { + this.btnsLeftWidth = this.left ? this.left.offsetWidth : 0; + this.btnsRightWidth = this.right ? this.right.offsetWidth : 0; + }, 300); document.body.addEventListener('touchstart', this.onCloseSwipe, true); }