fix: content editable retarget

This commit is contained in:
Peng Xiao 2024-03-04 18:28:10 +08:00
parent d5d4f591f3
commit 7d1cfb5057
2 changed files with 2 additions and 2 deletions

View file

@ -459,7 +459,7 @@ export class InjectedScript {
return null;
if (behavior === 'none')
return element;
if (!element.matches('input, textarea, select')) {
if (!element.matches('input, textarea, select') && !(element as any).isContentEditable) {
if (behavior === 'button-link')
element = element.closest('button, [role=button], a, [role=link]') || element;
else

View file

@ -250,7 +250,7 @@ it('input value retargeting', async ({ page, browserName }) => {
}
});
it.fixme('selection retargeting', async ({ page, browserName }) => {
it('selection retargeting', async ({ page, browserName }) => {
const cases = [
{ dom: domStandalone(`<div contenteditable id=target>content</div>`), locator: 'div' },
{ dom: domInButton(`<div contenteditable id=target>content</div>`), locator: 'div' },