react-swipeable-list is not working as expected

756 views Asked by At

I'm using @sandstreamdev/react-swipeable-list package in one of my project to create a swipeable list with React. Explored the docs and thought of experimenting with one of the examples mentioned in it. Here is the application created by copying code from the given example. But it is behaving unexpectedly.

Actual Behavior:

image describing actual behavior

Expected Behavior:

image describing expected behavior

Whenever the list item shown is swiped right or left it should display reply or delete option accordingly under the list item. But instead the options are shown all the time. I think the issue here is with the CSS but I'm not sure exactly where I messed it up. Please help me in resolving this issue.

1

There are 1 answers

0
Nicolas Menettrier On BEST ANSWER

You forgot to import the css of the library.

import '@sandstreamdev/react-swipeable-list/dist/styles.css';

here is the fix

https://codesandbox.io/s/twilight-waterfall-lhkfo