-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chery-pick(#14267): fix: page.locator.focus() and page.locator(…).typ…
…e(…) (#14296) cherry-pick of fbb364c: 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 7a5b070 (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.
- Loading branch information
Showing
3 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters