Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some suggestions #12

Closed
derwaldgeist opened this issue Jan 4, 2021 · 3 comments
Closed

Some suggestions #12

derwaldgeist opened this issue Jan 4, 2021 · 3 comments

Comments

@derwaldgeist
Copy link

I like the idea of mimicking the behavior of iOS.

However, there are some issues in this component:

  1. It doesn't prevent rubber-banding of the enclosing web page. If I try out the example on an iPhone, the whole page is being swiped instead of just the item under your finger.
  2. If you swipe in a native list, you just have to drag the item slightly to reveal the "Delete" button. In your component, I have to swipe a certain minimum amount. This doesn't feel as fluid as in the native components.

So far, I haven't found a component that really mimics the iOS behavior. Thus, it would be great if this component could be improved.

@arnaudambro
Copy link
Owner

hey @derwaldgeist, good points, maybe you can make a PR with these changes ?
I've not been very active lately, and some people where waiting for me to merge one PR for a long time, but now I'll be more consistent : if you do a PR, I'll merge !

@Dharuman007
Copy link

Hi,
i need to show modal while click delete

@korbav
Copy link

korbav commented May 21, 2021

Hi,
i need to show modal while click delete

Hi, please create a new issue next time to keep things clear for everyone.
Regarding your need, I advise you to rely on the onDelete handler, eg:

<SwipeToDelete
    onDelete={() => showModal(params)}
...
/>

If you want to be able to take a decision on the deletion you can also make use of preventDefault this way: onDelete={(e) => { if (!mustDelete) e.preventDefault(); } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants