@arlenwang/react-native-swipeout
Advanced tools
Comparing version
{ | ||
"name": "@arlenwang/react-native-swipeout", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "iOS-style swipeout buttons behind component", | ||
@@ -8,3 +8,2 @@ "main": "src/index.js", | ||
"scripts": { | ||
"build": "rm -rf dist && cross-env BABEL_ENV=commonjs babel src --out-dir dist", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -11,0 +10,0 @@ }, |
@@ -368,6 +368,7 @@ import tweenState from 'react-tween-state'; | ||
right: { | ||
//left: Math.abs(contentWidth + Math.max(limit, posX)), | ||
left: Math.abs(contentWidth + Math.max(limit, posX)), | ||
right: 0, | ||
}, | ||
}; | ||
//console.log('contentWidth',styleRightPos.right.left,contentWidth,limit,posX) | ||
var styleContentPos = { | ||
@@ -382,4 +383,3 @@ content: { | ||
var styleRight = [styles.swipeoutBtns]; | ||
styleRight.push(styleRightPos.right); | ||
var styleRight = {...styles.swipeoutBtns,...styleRightPos.right}; | ||
@@ -418,3 +418,7 @@ var styleLeft = [styles.swipeoutBtns]; | ||
if (buttons && isVisible) { | ||
console.log('style',style) | ||
let addWidth = 0; | ||
buttons.forEach((item,index)=>{ | ||
if(item.buttonWidth)addWidth +=item.buttonWidth | ||
}) | ||
if(addWidth>0)style.left = style.left- addWidth; | ||
return (<View style={style}> | ||
@@ -421,0 +425,0 @@ {buttons.map(this._renderButton)} |
26508
0.66%578
0.7%