diff --git a/packages/playwright-core/src/server/injected/injectedScript.ts b/packages/playwright-core/src/server/injected/injectedScript.ts index 1b8160194d..8a73b9e423 100644 --- a/packages/playwright-core/src/server/injected/injectedScript.ts +++ b/packages/playwright-core/src/server/injected/injectedScript.ts @@ -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 diff --git a/tests/page/retarget.spec.ts b/tests/page/retarget.spec.ts index 203ac5bd16..4465643d77 100644 --- a/tests/page/retarget.spec.ts +++ b/tests/page/retarget.spec.ts @@ -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(`
content
`), locator: 'div' }, { dom: domInButton(`
content
`), locator: 'div' },