Coder Social home page Coder Social logo

Comments (9)

arielsalminen avatar arielsalminen commented on July 28, 2024

This works as intended to provide as fast response time as possible.

It's up to the designer/developer to not put the toggle in a place where this functionality would cause harm to the user.

from responsive-nav.js.

MalabarFront avatar MalabarFront commented on July 28, 2024

I disagree with your argument on this one. There's nowhere on the page where you could guarantee a user won't place their thumb to scroll and swipe, so the plugin firing events on touchstart, to me, is the source of the harm, not the placement of the toggle button.

There are ways to eliminate the 300ms delay without introducing this behaviour. As Google themselves say: "If the user touches down on the button and then drags the screen a bit and then invokes a touchend on the button then we should not fire a click." (Source: https://developers.google.com/mobile/articles/fast_buttons)

And Fastclick (https://github.com/ftlabs/fastclick) also avoids this problem.

Obviously this is your project, I'm just putting two pennies in as to what I think the sensible behaviour should be.

from responsive-nav.js.

arielsalminen avatar arielsalminen commented on July 28, 2024

@MalabarFront I reopened the issue, maybe we can come up with a good solution to this :)

from responsive-nav.js.

cubiq avatar cubiq commented on July 28, 2024

add a touchmove even and cancel the tap if it is fired (with a 5-10px threshold)

from responsive-nav.js.

arielsalminen avatar arielsalminen commented on July 28, 2024

@cubiq Sounds like a good and simple solution!

from responsive-nav.js.

arielsalminen avatar arielsalminen commented on July 28, 2024

I have a new version now coming which uses 10px threshold and triggers the menu open on touchend if there's no touchmove. Need just a bit more device testing before pushing to GitHub.

from responsive-nav.js.

challahan avatar challahan commented on July 28, 2024

Any updates on this one? I'm having the same issue, as my menu is placed further down my page and gets triggered by accident when the user is scrolling.

from responsive-nav.js.

arielsalminen avatar arielsalminen commented on July 28, 2024

@challahan This issue is fixed in the latest release I just pushed.

from responsive-nav.js.

challahan avatar challahan commented on July 28, 2024

You're awesome - thank you!

from responsive-nav.js.

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.