Playwright: [BUG] Keyboard shortcuts on mac do not work

Created on 19 Feb 2020  路  2Comments  路  Source: microsoft/playwright

Context:

  • Playwright Version: 0.11.1
  • Operating System: Mac

Code Snippet

const playwright = require("playwright");

(async () => {
  const browser = await playwright.chromium.launch({ headless: false });
  const page = await browser.newPage();
  await page.goto("https://google.com");

  const element = await page.$('css=[aria-label="Search"]');

  await element.focus();

  await page.keyboard.type("123");

  // Select all does not work
  // await page.keyboard.down("MetaLeft");
  // await page.keyboard.down("KeyA");
  // await page.keyboard.up("KeyA");
  // await page.keyboard.up("MetaLeft");

  // workaround for select all
  await element.evaluate(element => element.select());

  // Cut does not work
  await page.keyboard.down("MetaLeft");
  await page.keyboard.down("KeyX");
  await page.keyboard.up("KeyX");
  await page.keyboard.up("MetaLeft");

  // Paste does not work
  await page.keyboard.down("MetaLeft");
  await page.keyboard.down("KeyV");
  await page.keyboard.up("KeyV");
  await page.keyboard.up("MetaLeft");
})();

Select All, Cut, and Paste do not seem to work.

Is Mac chromium not supported?

v1.2

Most helpful comment

Correct, some mac+chromium editing commands don't work. It requires some upstream work.

All 2 comments

Correct, some mac+chromium editing commands don't work. It requires some upstream work.

Removing the v1 label. We'll follow up later, for now there is elementHandle.selectText

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pdehaan picture pdehaan  路  3Comments

Sue9445 picture Sue9445  路  4Comments

JoelEinbinder picture JoelEinbinder  路  4Comments

saltyshiomix picture saltyshiomix  路  3Comments

grajesh690 picture grajesh690  路  3Comments