docs(api): replace select-all note with example (#3328)
This commit is contained in:
parent
411c738026
commit
4ec3290da3
10
docs/api.md
10
docs/api.md
|
|
@ -3309,14 +3309,20 @@ await page.keyboard.press('Backspace');
|
||||||
// Result text will end up saying 'Hello!'
|
// Result text will end up saying 'Hello!'
|
||||||
```
|
```
|
||||||
|
|
||||||
An example of pressing `A`
|
An example of pressing uppercase `A`
|
||||||
```js
|
```js
|
||||||
await page.keyboard.press('Shift+KeyA');
|
await page.keyboard.press('Shift+KeyA');
|
||||||
// or
|
// or
|
||||||
await page.keyboard.press('Shift+A');
|
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 -->
|
<!-- GEN:toc -->
|
||||||
- [keyboard.down(key)](#keyboarddownkey)
|
- [keyboard.down(key)](#keyboarddownkey)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue