This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Don't attach POI 'hover' interaction on mobile devices #1010
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add a
isMobileDevice
check around the declaration of hover interactions on POIs, as they can be properly done on touch-based device.This is an imperfect solution, as it doesn't react to screen size changes after loads and uses the screen size as a criterion for determining if the device is touch-based, but I did it because we already solved the same problem on the dynamic POI layer the same way https://github.com/QwantResearch/erdapfel/blob/master/src/adapters/scene_category.js#L93-L96
A better way to implement that is to use a
hover
media query, but as this isn't supported on IE11 it would disable on this browser.I've added this to the list of things we can improve after we ditch IE11.