Fixed the problem that touchmove cannot be disabled when preventDefault is invoked on touchstart. (#36200)

Signed-off-by: kongbai1996 <1782765876@qq.com>
This commit is contained in:
Bi Fuguo 2025-03-29 07:00:52 +08:00 committed by GitHub
parent 95c3033456
commit 53f7c7b1de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -574,11 +574,13 @@ impl WebView {
self.touch_handler
.set_handling_touch_move(self.touch_handler.current_sequence_id, false);
if let Some(info) = self.touch_handler.get_touch_sequence_mut(sequence_id) {
info.prevent_move = TouchMoveAllowed::Allowed;
if let TouchSequenceState::PendingFling { velocity, cursor } =
info.state
{
info.state = TouchSequenceState::Flinging { velocity, cursor }
if info.prevent_move == TouchMoveAllowed::Pending {
info.prevent_move = TouchMoveAllowed::Allowed;
if let TouchSequenceState::PendingFling { velocity, cursor } =
info.state
{
info.state = TouchSequenceState::Flinging { velocity, cursor }
}
}
}
},