From 3e2eb0f6f62551688669365dafec626833cef0a1 Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Fri, 22 May 2026 03:58:37 -0700 Subject: [PATCH] docs(tap): fix awkward grammar in hasTouch note The note in Page.tap had "[method: Page.tap] the method will throw..." which rendered as "page.tap() the method will throw..." in published docs, doubling up "tap" and "the method". Drop the redundant words. Touchscreen.tap had the same note copied verbatim with the wrong cross-reference; switch it to Touchscreen.tap so the link matches the method it documents. Frame.tap and Locator.tap already use a clean " will throw / requires" form, so this brings Page.tap and Touchscreen.tap into line with them. Generated types.d.ts files are regenerated by npm run build to pick up the updated note text. --- docs/src/api/class-page.md | 2 +- docs/src/api/class-touchscreen.md | 2 +- packages/playwright-client/types/types.d.ts | 8 ++++---- packages/playwright-core/types/types.d.ts | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index 1074568d209e7..ad2778b81b933 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -4299,7 +4299,7 @@ When all steps combined have not finished during the specified [`option: timeout [TimeoutError]. Passing zero timeout disables this. :::note -[`method: Page.tap`] the method will throw if [`option: Browser.newContext.hasTouch`] option of the browser context is false. +[`method: Page.tap`] will throw if the [`option: Browser.newContext.hasTouch`] option of the browser context is false. ::: ### param: Page.tap.selector = %%-input-selector-%% diff --git a/docs/src/api/class-touchscreen.md b/docs/src/api/class-touchscreen.md index d7871addd7a00..56af3301c1dbb 100644 --- a/docs/src/api/class-touchscreen.md +++ b/docs/src/api/class-touchscreen.md @@ -12,7 +12,7 @@ This class is limited to emulating tap gestures. For examples of other gestures Dispatches a `touchstart` and `touchend` event with a single touch at the position ([`param: x`],[`param: y`]). :::note -[`method: Page.tap`] the method will throw if [`option: Browser.newContext.hasTouch`] option of the browser context is false. +[`method: Touchscreen.tap`] will throw if the [`option: Browser.newContext.hasTouch`] option of the browser context is false. ::: ### param: Touchscreen.tap.x diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index 5136b94b64618..a257e5fd2e41c 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -4530,8 +4530,8 @@ export interface Page { * [`timeout`](https://playwright.dev/docs/api/class-page#page-tap-option-timeout), this method throws a * [TimeoutError](https://playwright.dev/docs/api/class-timeouterror). Passing zero timeout disables this. * - * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw - * if [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the + * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) will throw if the + * [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the * browser context is false. * * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be @@ -21548,8 +21548,8 @@ export interface Touchscreen { * Dispatches a `touchstart` and `touchend` event with a single touch at the position * ([`x`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-x),[`y`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-y)). * - * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw - * if [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the + * **NOTE** [touchscreen.tap(x, y)](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap) will throw if + * the [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the * browser context is false. * * @param x X coordinate relative to the main frame's viewport in CSS pixels. diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 5136b94b64618..a257e5fd2e41c 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -4530,8 +4530,8 @@ export interface Page { * [`timeout`](https://playwright.dev/docs/api/class-page#page-tap-option-timeout), this method throws a * [TimeoutError](https://playwright.dev/docs/api/class-timeouterror). Passing zero timeout disables this. * - * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw - * if [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the + * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) will throw if the + * [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the * browser context is false. * * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be @@ -21548,8 +21548,8 @@ export interface Touchscreen { * Dispatches a `touchstart` and `touchend` event with a single touch at the position * ([`x`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-x),[`y`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-y)). * - * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw - * if [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the + * **NOTE** [touchscreen.tap(x, y)](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap) will throw if + * the [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the * browser context is false. * * @param x X coordinate relative to the main frame's viewport in CSS pixels.