playwright/packages
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
..
html-reporter chore: add more ct options to allow redirecting templates/cache (#14077) 2022-05-10 12:21:29 -07:00
playwright chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-chromium chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-core chery-pick(#14267): fix: page.locator.focus() and page.locator(…).type(…) (#14296) 2022-05-19 15:19:39 -07:00
playwright-ct-react chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-ct-svelte chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-ct-vue chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-firefox chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
playwright-test cherry-pick(#14264): chore: more testing-friendly trace (#14276) 2022-05-19 07:04:32 -07:00
playwright-webkit chore: mark 1.22.1 (#14210) 2022-05-17 03:00:26 -07:00
recorder fix(debug): do not pause on internal calls, update ct docs (#14018) 2022-05-07 19:56:25 -07:00
trace-viewer fix(debug): do not pause on internal calls, update ct docs (#14018) 2022-05-07 19:56:25 -07:00
web chore: add more ct options to allow redirecting templates/cache (#14077) 2022-05-10 12:21:29 -07:00
.eslintrc.js chore: don't write into stdout from the test runner, use reporters instead (#11367) 2022-01-12 19:52:40 -08:00