docs(api): replace select-all note with example (#3328)

This commit is contained in:
Arjun Attam 2020-08-06 21:23:30 -07:00 committed by GitHub
parent 411c738026
commit 4ec3290da3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3309,14 +3309,20 @@ await page.keyboard.press('Backspace');
// Result text will end up saying 'Hello!'
```
An example of pressing `A`
An example of pressing uppercase `A`
```js
await page.keyboard.press('Shift+KeyA');
// or
await page.keyboard.press('Shift+A');
```
> **NOTE** On MacOS, keyboard shortcuts like `⌘ A` -> Select All do not work. See [#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)
An example to trigger select-all with the keyboard
```js
// on Windows and Linux
await page.keyboard.press('Control+A');
// on macOS
await page.keyboard.press('Meta+A');
```
<!-- GEN:toc -->
- [keyboard.down(key)](#keyboarddownkey)