From c90e96761f1cb036071b452261fef347dcc70502 Mon Sep 17 00:00:00 2001 From: ayaangazali Date: Fri, 21 Aug 2026 10:10:27 -0700 Subject: [PATCH] fix(android): include the from point in input.swipe swipe(from, segments, steps) documents from as the point to start swiping from, and segments as the points following it, but only segments reached the driver, so the gesture actually began at segments[0]. The channel has no from field, so prepending it to segments keeps the protocol and the device driver unchanged. drag() already forwards its own from, which is why this one stood out. --- packages/playwright-core/src/client/android.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/client/android.ts b/packages/playwright-core/src/client/android.ts index bad1546eab08b..fa72c42b8226c 100644 --- a/packages/playwright-core/src/client/android.ts +++ b/packages/playwright-core/src/client/android.ts @@ -335,7 +335,8 @@ export class AndroidInput implements api.AndroidInput { } async swipe(from: types.Point, segments: types.Point[], steps: number) { - await this._device._channel.inputSwipe({ segments, steps }, kNoTimeout); + // `from` is the first point of the gesture, `segments` are the points following it. + await this._device._channel.inputSwipe({ segments: [from, ...segments], steps }, kNoTimeout); } async drag(from: types.Point, to: types.Point, steps: number) {