-
Notifications
You must be signed in to change notification settings - Fork 57
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
'touch' detection is invalid #188
Comments
Thanks for the issue and PR. I hope to be able to take a closer look at this next week. 👍 |
For such an excellent plugin, I would like to share my demo, my touch can be used well! There are also hover prompts and one-click copy (he can jump to the anchor by clicking on it). |
Hey, @nichoth, thanks for reporting the issue. This issue has come up before and been discussed in detail here: #168 In short, your fix addresses some common device use-cases but breaks others because there's no reliable way to detect a touchscreen. 😞 Ultimately, this touch feature is misleading and I plan to remove it entirely in a future version of AnchorJS. My recommendation is that if you want the older behavior of this, you can use version 4.2.2 as described here. |
Ok thanks for checking it out. I am using my fork currently, and that has been working for me. |
Using this on a laptop computer, and I have set
However, it is detecting that a laptop is a touch device. When I look at the source code and try some in the browser console,
!!window.TouchEvent
is returning true, which is here in the source code — https://github.com/bryanbraun/anchorjs/blob/master/anchor.js#L52example in use: https://nichoth.com/list/
The text was updated successfully, but these errors were encountered: