marekrozmus / react-swipeable-list

Swipeable list component for React supporting several behaviours (e.g. iOS)
https://marekrozmus.github.io/react-swipeable-list/
MIT License
110 stars 20 forks source link

Don't work in localhost with IOS twoaction button but work in codesandbox #33

Open IamAhsanMani opened 1 year ago

IamAhsanMani commented 1 year ago

I am using react-swipeable-list with type IOS two action button where in example it show when we swipe from left side and release it, It hold and show two buttons but in my case when i swipe from left side and after releasing it, It just go back to it's original position without showing actions button.

I attach the behaviour in gif format issue video

But the same code work fine in codesandbox as you can see in below attach gif codesandbox

Don't know what is the actual issue. I try it on safari, chrome and firefox in any of these it is not working.

Link to the code in sandbox

marekrozmus commented 1 year ago

Unfortunately ;) that code works for me OK on all browsers I have here (brave, edge, firefox and chrome). I have also tested on different node versions 14 and 16. No idea what could be the problem :(

IamAhsanMani commented 1 year ago

@marekrozmus that’s said :(

JNuno007 commented 1 year ago

It is happening to me too, I am using NextJS v12, MUI and NodeJS v18.

I have tried with node v16 and the same thing happens.

Have you figured it out?

IamAhsanMani commented 1 year ago

@JNuno007 not at all. and i force myselft to optout using it.

JNuno007 commented 1 year ago

@IamAhsanMani same, unfortunately I've made a natively solution and also opted out.

BenjaminBecic commented 1 year ago

I am facing the same problem. Does anyone have a solution? This bug makes it unusable. Could the issue be related to the display style attribute? Does it require a specific arrangement of div elements with 'display: flex' or something similar?

BenjaminBecic commented 1 year ago

I found out why it didn't work. I used fullSwipe={false} and listType={Type.IOS} on the . After going through the source code of react-swipeable-list, I was wondering why it still had Symbol(Android) as a property and was still firing leadingFullSwipeAction.

I discovered that for my use case, the correct place for these properties is the component. There, I put type={Type.IOS} and fullSwipe={false}, and it works now.

Before:

<SwipeableList>
  ...
  <SwipeableListItem
    key={idx}
    trailingActions={trailingActions()}
    maxSwipe={0.7}
    threshold={0.2}
    listType={Type.IOS}
    fullSwipe={false}
  >
 ...
  </SwipeableListItem>
</SwipeableList>

After:

<SwipeableList type={Type.IOS} fullSwipe={false}  >
...
<SwipeableListItem
                        key={idx}
                        trailingActions={trailingActions()}
                        maxSwipe={0.7}
                        threshold={0.2}
                    >

 ...
  </SwipeableListItem>
</SwipeableList>
marekrozmus commented 10 months ago

@BenjaminBecic Thanks for the comment. BTW In the docs I wrote the type and fullSwipe should be in SwipeableList not in the SwipeableListItem :)

tgoldenberg commented 3 months ago

Also having this, despite correct application of the type={ListType.IOS} attribute on the SwipeableList

@jkrup