Code Monkey home page Code Monkey logo

Comments (3)

gaer87 avatar gaer87 commented on May 27, 2024

Hi zuus-keith,
Thank you!

Is it possible to disable a swipe direction?

I can't imagine it. Users can change a swipe direction after they start interaction. For example, it can be to cancel.

Or better yet a prop that you can provide to say which swipe direction will trigger the delete?

Would you like to get this prop in an "onDelete" callback?

Also, here are "onRight/onLeft" calbacks.
Can they help you?

from react-swipe-to-delete-component.

zuus-keith avatar zuus-keith commented on May 27, 2024

I can't imagine it. Users can change a swipe direction after they start interaction. For example, it can be to cancel.

Can't we determine which direction direction the mouse is moving? For example we want to disable swiping right, if the mousemove event is moving right ignore any further events until other mousedown is called.

Would you like to get this prop in an "onDelete" callback?

This doesn't help because once the user's interaction moves towards a particular direction that will trigger either onRight/onLeft, the callback is called immediately which isn't the behaviour I want; I still want it to obey the value we set in deleteSwipe.

from react-swipe-to-delete-component.

gaer87 avatar gaer87 commented on May 27, 2024

Can't we determine which direction direction the mouse is moving?

Yes, we can, but we can only don't move a component to the left or to the right. A cursor of mouse're moving in any case. I guess it can confuse users.

If users'll swipe more than a value of "deleteSwipe" and then they'll decide to cancel to remove an item they won't be able to do it, because they won't be able to move to opposite direction. I guess it can be dangerously.

from react-swipe-to-delete-component.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.