playwright/packages/playwright-core
Ross Wollman abd4258080
chery-pick(#14267): fix: page.locator.focus() and page.locator(…).type(…) (#14296)
cherry-pick of fbb364c1cd0dec9e4a75b885d51e67ca397b1d6a:

Fixes focus and blur management when `page.locator(…).focus()`  and  `page.locator(…).type(…)` are used which was regressed by 7a5b070 (#13510).

However, some elements are [not focusable](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area), so we were blurring incorrectly, and losing focus that we should have maintained.

Two regression tests were added that pass on the commit prior to 7a5b070e95 (and match manual testing/expectations):

* `page.locator(…).focus()`: _keeps focus on element when attempting to focus a non-focusable element_
* `page.locator(…).type(…)`: _should type repeatedly in input in shadow dom_

Additionally, a third test (_should type repeatedly in input in shadow dom_) was added to check the invariant from #13510 that states:

> This affects [contenteditable] elements, but not input elements.

and allows us to introduce the targeted fix (contenteditble check before blur) without breaking FF again.

And _should type repeatedly in contenteditable in shadow dom with nested elements_ was added to ensure the above fix works with nest contenteditble detection.

Fixes #14254.
2022-05-19 15:19:39 -07:00
..
bin fix: proper chrome-beta channel installation on MacOS (#11973) 2022-02-09 11:28:51 -08:00
bundles feat(plugins): expose suite to plugin setup (#13807) 2022-04-28 08:16:17 -07:00
src chery-pick(#14267): fix: page.locator.focus() and page.locator(…).type(…) (#14296) 2022-05-19 15:19:39 -07:00
types cherry-pick(#14200): chore: fix wrong toHaveScreenshot defaults in docs (#14201) 2022-05-17 07:42:20 +03:00
.npmignore chore: babel, expect, zip bundles (#13588) 2022-04-18 11:31:58 -07:00
browsers.json fix(chromium): work around about:blank issue on Chromium (#14068) 2022-05-10 20:32:19 +01:00
cli.js chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.d.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.js chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
index.mjs fix: export request from index.jsm (#13158) 2022-03-30 09:35:47 -07:00
package.json chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
README.md chore: drop dependency on playwright-core in all our packages (#2318) 2020-05-21 13:18:15 -07:00
ThirdPartyNotices.txt chore: bundle pwt deps (#13622) 2022-04-18 21:47:18 -07:00

playwright-core

This package contains the no-browser flavor of Playwright.