Safari IpadOS14 missing PointerEvents with Scribble

In my company we made tools about handwriting recognition, we have apps run in the browser. We use PointerEvents to get the ink with a pen.

Since IpadOS14 and Scribble feature, we notice a huge regression on our webapp, a lot of "ink" is missing while writing with Apple Pencil.

I made a simple example to show the probleme:

Code Block html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
}
#editor {
width: 50%;
height: 50%;
background-color: beige;
touch-action: none;
}
</style>
</head>
<body>
<div id="editor"></div>
<script>
const editor = document.getElementById('editor')
const print = event => console.log(`[${event.type}] with ${event.pointerType} {${event.pointerId}}`)
editor.addEventListener('pointerdown', print)
editor.addEventListener('pointerup', print)
</script>
</body>
</html>


When writing "Hello how are you" on the "editor" :

1 - With Scribble
=> only 3 pointerdown events

2 - Without Scribble
=> 4 pointerdown events

Scribble should be only active on focused input field ?
Am I missing something ?
Answered by L4ngu0r in 641981022
Hello!

Thank you, that works indeed !

I have also fill a webkit bug : https://bugs.webkit.org/show_bug.cgi?id=217430
Hey there - I just ran into the same issue.

I found a work around -- use a "touchmove" event on your target and preventDefault on it. That seems to stop the PointerEvent(s) getting swallowed. Wrote about it here: mikepk.com/2020/10/iOS-safari-scribble-bug
Accepted Answer
Hello!

Thank you, that works indeed !

I have also fill a webkit bug : https://bugs.webkit.org/show_bug.cgi?id=217430
Safari IpadOS14 missing PointerEvents with Scribble
 
 
Q