Skip to content

Commit 999711f

Browse files
committed
test(webkit): closing dialog > contenteditable
1 parent bdf5e52 commit 999711f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/page/page-keyboard.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,3 +714,21 @@ Keydown: Escape Escape STANDARD []
714714
Keyup: Escape Escape STANDARD []
715715
`.trim());
716716
});
717+
718+
it('should close dialog on Escape key press in contenteditable', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/36727' } }, async ({ page }) => {
719+
await page.setContent(`
720+
<dialog>
721+
<div contenteditable>Edit Me</div>
722+
</dialog>
723+
`);
724+
725+
const dialog = page.locator("dialog");
726+
const widget = dialog.locator("[contenteditable]");
727+
await dialog.evaluate((node: HTMLDialogElement) => node.showModal());
728+
await expect(dialog).toHaveJSProperty("open", true);
729+
await expect(widget).toBeVisible();
730+
731+
await widget.press("Escape");
732+
await expect(dialog).toHaveJSProperty("open", false);
733+
await expect(widget).not.toBeVisible();
734+
})

0 commit comments

Comments
 (0)