Swiping over a link will not trigger browser opening (#1002)

This commit is contained in:
Stanislav Dmitrenko
2022-09-01 22:28:58 +03:00
committed by GitHub
parent 4c60309d1d
commit fc31b404d7

View File

@@ -86,11 +86,7 @@ suspend fun PointerInputScope.detectGesture(
} else {
if (shouldConsume)
upOrCancel.consumeDownChange()
// If onLongPress event is needed, cancel short press event
if (onLongPress != null)
pressScope.cancel()
else
pressScope.release()
pressScope.release()
}
} catch (_: PointerEventTimeoutCancellationException) {
onLongPress?.invoke(down.position)
@@ -176,7 +172,7 @@ private class PressGestureScopeImpl(
if (!isReleased && !isCanceled) {
mutex.lock()
}
return isCanceled
return isReleased && !isCanceled
}
}