playcanvas / playcanvas/engine
Difference between input behaviour on elements between touch and mouse
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Touch input events and mouse event behave differently between on the UI elements.
The touchend event is called on the element that matches the touch id during the touchstart event which can be a different element that the finger is over.
Mouseup event is called on whatever the mouse is currently over when the button is let go.
See examples here where the fullscreen elements are disabled/enabled on touchstart/mousedown:
https://playcanvas.com/editor/scene/939550 (Mouse event)
https://playcanvas.com/editor/scene/939543 (Touch event)
On the touch example, the output is the following:
white touchstart
white touchend
On the mouse example, the output is:
white mousedown
red mouseup
Ideally the two should match in behaviour. Not sure which one to change as either has the potential to break projects that relied on touchend being called on the element that was touchstarted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the linked mouse and touch examples and trace the touchstart/touchend and mousedown/mouseup event entry points. Decide which release-target behavior is intended without breaking existing touch projects, then verify that the chosen behavior is consistent across the examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100