ionic-team / ionic-team/cordova-plugin-ionic-webview

[iOS 15.5] Incorrect events on canvas long press

Open
#670 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
493
Forks
410
PR merge metrics
No merged PRs in 30d

Description

In the following simple scenario I created there are different events fired when using the plugin versus not using this plugin.
Here is the following code to reproduce - I've moved everything related to Cordova to a single html file:
This basically draws the events that are captured from the canvas to a `ul` element.
When not using the plugin the only event that are fired when using long click are:
`touchstart` and `touchend`
When using this plugin there are more event related to mouse operations which shouldn't be fired:
`touchstart`
`touchend`
`mousemove`
`mousedown`
`mouseup`

I think this is new, maybe in 15.4 or so as I think this was not present in 15.0.
It happens only on "long click" and not on "regular click".
Please let me know how I can help further debug this issue.

```html








Long Press Event Issues



Clear list





document.addEventListener('deviceready', onDeviceReady, false);

let list = document.getElementById('list');;

function clearList() {
list.innerHTML = '';
}

function add(name) {
let li = document.createElement("li");
li.appendChild(document.createTextNode(name));
list.appendChild(li);
console.log(name);
}

function onDeviceReady() {
var canvas = document.getElementById('canvas1');
canvas.addEventListener("mousedown", () => {
add('mousedown');
});
canvas.addEventListener("touchstart", () => {
add('touchstart');
});
canvas.addEventListener("mousemove", () => add('mousemove'));
canvas.addEventListener("touchmove", () => add('touchmove'));
canvas.addEventListener("mouseup", (e) => {
e.preventDefault();
add('mouseup');
});
canvas.addEventListener("touchend", (e) => {
e.preventDefault();
add('touchend');
});
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.