Skip to content

Commit 29ed59c

Browse files
committed
fix opacity issue on react-native-web
1 parent 681f516 commit 29ed59c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ class SwipeableItem<T> extends React.PureComponent<Props<T>> {
423423
pointerEvents={
424424
swipeDirection === OpenDirection.LEFT ? "auto" : "none"
425425
}
426-
style={[styles.underlay, { opacity: this.leftActive }]}
426+
style={[
427+
styles.underlay,
428+
{ opacity: cond(greaterThan(this.percentOpenLeft, 0), 1, 0) }
429+
]}
427430
>
428431
{renderUnderlayLeft({
429432
item,
@@ -437,7 +440,10 @@ class SwipeableItem<T> extends React.PureComponent<Props<T>> {
437440
pointerEvents={
438441
swipeDirection === OpenDirection.RIGHT ? "auto" : "none"
439442
}
440-
style={[styles.underlay, { opacity: not(this.leftActive) }]}
443+
style={[
444+
styles.underlay,
445+
{ opacity: cond(greaterThan(this.percentOpenRight, 0), 1, 0) }
446+
]}
441447
>
442448
{renderUnderlayRight({
443449
item,

0 commit comments

Comments
 (0)