Frontmatter
| id | 3267 |
| title | Touch Support |
| state | Closed |
| labels | bug |
| assignees | [] |
| createdAt | Jul 5, 2022, 2:10 PM |
| updatedAt | Jul 11, 2022, 4:57 PM |
| githubUrl | https://github.com/neomjs/neo/issues/3267 |
| author | Dinkh |
| commentsCount | 5 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jul 11, 2022, 4:57 PM |
Touch Support

what is IEMobile xD
Can you try this one on Windows to check for mouse support please?
matchMedia('(pointer:fine)').matches (e.g. just drop it into the console)

returns true.

for me, it also returns false in case i switch to a mobile view in chrome.
my strategy would be to use this one to check for a mouse => if true use the mouse sensor, then use our previous touch check => else if true use the touch sensor.
a follow up ticket could be to adjust at run-time (e.g. a user plugs in a mouse after a neo app got loaded).

Did you reload and check isMobile again. Should work, probably a Mac issue?

added the option to add BOTH sensors in case hasMouseSupport() and hasTouchSupport() both return true.
however, this does not include the edge case to start a drag OP with the mouse, then finish a touch based DD OP and afterwards drop with the mouse. feel free to add a new ticket in case this one is needed.
Describe the bug The current implementation of touch support has the premiss that there is either touch support OR mouse support. My laptop has a touchscreen and still supports mouse.
Because it is detected as touch support, it does not allow drag'n drop for the mouse.
Desktop (please complete the following information):
Additional context Possible solution:
Detect if isMobile
isMobile() { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); }If isMobile do not support mouse support. If !isMobile support touch AND mouse