-
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
Anchor icon is always visible on Windows when visible=touch after promoted to v4.3.0 #168
Comments
Thanks for the detailed report. You're totally right about where that new behavior is coming from. Unfortunately, the behavior you're seeing is intended. To quote the docs:
If you're seeing the links in your browser on Windows 10, that means your browser supports touch events (more specifically, The change that you saw in the newer AnchorJS version comes from a similar Modernizr update, which was intended to make touch event detection more accurate. You can see details on that here: Modernizr/Modernizr#2409 Ultimately, I'm comfortable leaving this feature as-is, focused on detecting touch-events, which only approximates touchscreen detection. The alternative is to remove the feature altogether (which is what Modernizr eventually did). If you prefer the former behavior, I'd say feel free to continue using v4.2.2. |
Thanks for the reply, closing the issue now |
This option does not work in many browsers as expected in PR 218 https://caniuse.com/touch bryanbraun/anchorjs#168 Signed-off-by: Takuya Noguchi <[email protected]>
|
This option does not work in many browsers as expected in PR 218 https://caniuse.com/touch bryanbraun/anchorjs#168 Signed-off-by: Takuya Noguchi <[email protected]>
Issue description
We identified a behavior change after promoted Anchorjs from v4.2.2 to v4.3.0.
We are using
visible: touch
as anchor options. Forv4.2.2
, the anchor ishover
on page ofWindows10
, after promoted tov4.3.0
, the anchor isalways
there instead ofhover
.Here are sample pages to help understand the issue:
v4.2.2 page(hover): https://kleisauke.github.io/net-vips-tests/api/NetVips.html
v4.3.0 page(always): https://kleisauke.github.io/net-vips/api/NetVips.html
Operating System: Windows
AnchorJs version: 4.3.0
Expected Behavior:
AnchorJS links only become visible when hovering over the headings like before for Windows when visible is touch.
Actual Behavior:
AnchorJS links are always visible for Windows when visible is touch.
Note:
This behavior change seems related to the newly added condition
window.TouchEvent
in functionisTouchDevice()
with this commitThe text was updated successfully, but these errors were encountered: