fix click event when long time in touchstart (#34812)

* fix click event when long time in touchstart

Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Bi Fuguo <1782765876@qq.com>

* update TouchAction::Click condition

Signed-off-by: Bi Fuguo <1782765876@qq.com>

---------

Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Bi Fuguo <1782765876@qq.com>
This commit is contained in:
Bi Fuguo 2025-01-14 14:44:27 +08:00 committed by GitHub
parent 90b41259d2
commit dd06416ed5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,7 +236,14 @@ impl TouchHandler {
Flinging { .. } => { Flinging { .. } => {
unreachable!("On touchup received, but already flinging.") unreachable!("On touchup received, but already flinging.")
}, },
WaitingForScript | DefaultPrevented | MultiTouch => { WaitingForScript => {
if self.active_touch_points.is_empty() {
self.state = Nothing;
return TouchAction::Click;
}
TouchAction::NoAction
},
DefaultPrevented | MultiTouch => {
if self.active_touch_points.is_empty() { if self.active_touch_points.is_empty() {
self.state = Nothing; self.state = Nothing;
} }