Skip to content

Commit 09be978

Browse files
authored
Correct parameter usage for click() in shadow.mdx (#6145)
* Update shadow.mdx - Update the suggestion to pass 'top' to cy.click() using the options defined in cy.click()'s documentation * Update shadow.mdx Add missing quote * Update shadow.mdx One-line for prettier reasons
1 parent 6ff2c73 commit 09be978

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/api/commands/shadow.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,10 @@ When working with `cy.click()`, it sometimes won't click the right element in
9696
Chrome. It's happening because of
9797
[the ambiguity in spec](https://bugs.chromium.org/p/chromium/issues/detail?id=1188919&q=shadowRoot%20elementFromPoint&can=2).
9898

99-
In this case, pass `{ position: 'top' }` to `cy.click()` like below:
99+
In this case, pass `'top'` to `cy.click()` like below:
100100

101101
```js
102-
cy.get('#element')
103-
.shadow()
104-
.find('[data-test-id="my-button"]')
105-
.click({ position: 'top' })
102+
cy.get('#element').shadow().find('[data-test-id="my-button"]').click('top')
106103
```
107104

108105
## Command Log

0 commit comments

Comments
 (0)