Skip to content

Commit 93bcee4

Browse files
committed
- [Fix][Web] Bug where touch events resulted in pointer enter being called after exit. This meant Views that were touched would always remain in the "pointer entered" state, which breaks many app interactions.
1 parent 8939fcf commit 93bcee4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Browser/src/commonMain/kotlin/io/nacular/doodle/system/impl/PointerInputServiceStrategyWebkit.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ internal open class PointerInputServiceStrategyWebkit(
187187
}
188188

189189
private fun pointerExit(event: PointerEvent) {
190+
if (event.pointerId == lastUpId) return // ignore this exit since it only comes for pointer devices after pointer up
191+
190192
eventHandler?.invoke(createPointerEvent(
191193
event,
192194
Move, //if (event.target == htmlFactory.root) Exit else Move,
@@ -208,7 +210,7 @@ internal open class PointerInputServiceStrategyWebkit(
208210
private fun pointerUp(event: PointerEvent): Boolean {
209211
lastUpId = event.pointerId
210212
preventScroll -= event.pointerId
211-
lastUpIsPointer = (event as? PointerEvent)?.pointerType == "touch"
213+
lastUpIsPointer = event.pointerType == "touch"
212214

213215
eventHandler?.invoke(createPointerEvent(event, Up, 1))
214216

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Version
22
# ---------------------------------------------
33
group = io.nacular.doodle
4-
version = 0.10.3
4+
version = 0.10.4
55
# ---------------------------------------------
66

77
# Gradle

0 commit comments

Comments
 (0)