LearnNewsExamplesServices
Frontmatter
id3267
titleTouch Support
stateClosed
labels
bug
assignees[]
createdAtJul 5, 2022, 2:10 PM
updatedAtJul 11, 2022, 4:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/3267
authorDinkh
commentsCount5
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 11, 2022, 4:57 PM

Touch Support

Closed v8.1.0 bug
Dinkh
Dinkh commented on Jul 5, 2022, 2:10 PM

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):

  • OS: Windows 11
  • Browser chrome

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

Dinkh added the bug label on Jul 5, 2022, 2:10 PM
tobiu
tobiu Jul 5, 2022, 2:33 PM

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)

Dinkh
Dinkh Jul 6, 2022, 9:22 AM

returns true.

tobiu
tobiu Jul 6, 2022, 9:33 AM

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).

Dinkh
Dinkh Jul 11, 2022, 1:36 PM

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

tobiu referenced in commit d69fdfc - "Touch Support #3267" on Jul 11, 2022, 4:55 PM
tobiu
tobiu Jul 11, 2022, 4:57 PM

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.

tobiu closed this issue on Jul 11, 2022, 4:57 PM
tobiu cross-referenced by #3146 on Jul 12, 2022, 2:05 PM