Giter VIP home page Giter VIP logo

Comments (3)

cortinico avatar cortinico commented on August 23, 2024

Hi @sebasira Thanks for submitting this feature request.

Unfortunately I haven't fully understood your request. Can you provide a real-world scenario or use case?

Generally, I don't think that having a timing attribute is a good idea. Ideally you should be able to achieve what you need only using event handlers.

from slidetoact.

sebasira avatar sebasira commented on August 23, 2024

I agree with you when you say

having a timing attribute is a good idea.

But I was thinking that maybe this behaviour could be encapsulated in this library.

The real-world scenario would be to prevent unwanted slides. I know it's difficult to accidentaly slide a button from one side to another, but in the app I'm developing the Users say they accidentaly do it most of the time. You could think of the requirement as a long-pressed button or the onLongClick event. As a safe-lock for the action.

If the User really wants to perform the actions he would have to slide it, keep it in the slided position and then release. If he just slide it, it would bump as locked.

And about

Ideally you should be able to achieve what you need only using event handlers.

Maybe if you give me some clues I can achieve it. I was thinking on locking the button and release the lock if it remains a certain amount of time on the slided position, but I don't know how I would know how much time it was. That's what I can figure out

from slidetoact.

cortinico avatar cortinico commented on August 23, 2024

Hi @sebasira
Thanks for your explanation, I got your point. I understand your scenario but this looks to me like a real niche use case. I'm afraid but I have to reject this feature request.

As a side note, you can probably achieve this behavior as you suggested:

Maybe if you give me some clues I can achieve it. I was thinking on locking the button and release the lock if it remains a certain amount of time on the slided position, but I don't know how I would know how much time it was. That's what I can figure out
  • Lock the slider
  • Fire an event (you need to create a new eventhandler) when the slider reaches the end
  • For that event you can start a timer that will enable the slider

You should also take care that you invalidate the timer if the user is moving back the slider with the finger (e.g. the user should stay in the area 80% - 100% of the slider for more than X seconds).

I hope I was helpful :)

from slidetoact.

Related Issues (20)

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.