From b85c4182aca32f238a95b970c063c6006be805d3 Mon Sep 17 00:00:00 2001 From: Matthew Sbar Date: Tue, 8 Apr 2025 16:52:06 -0500 Subject: [PATCH 1/3] Update shadow.mdx - Update the suggestion to pass 'top' to cy.click() using the options defined in cy.click()'s documentation --- docs/api/commands/shadow.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/commands/shadow.mdx b/docs/api/commands/shadow.mdx index 8f668a3197..c8ecab9e37 100644 --- a/docs/api/commands/shadow.mdx +++ b/docs/api/commands/shadow.mdx @@ -96,13 +96,13 @@ When working with `cy.click()`, it sometimes won't click the right element in Chrome. It's happening because of [the ambiguity in spec](https://bugs.chromium.org/p/chromium/issues/detail?id=1188919&q=shadowRoot%20elementFromPoint&can=2). -In this case, pass `{ position: 'top' }` to `cy.click()` like below: +In this case, pass `'top` to `cy.click()` like below: ```js cy.get('#element') .shadow() .find('[data-test-id="my-button"]') - .click({ position: 'top' }) + .click('top') ``` ## Command Log From afca5fa40076d95bb0412face5385aa516515bc8 Mon Sep 17 00:00:00 2001 From: Matthew Sbar Date: Tue, 8 Apr 2025 16:56:20 -0500 Subject: [PATCH 2/3] Update shadow.mdx Add missing quote --- docs/api/commands/shadow.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/commands/shadow.mdx b/docs/api/commands/shadow.mdx index c8ecab9e37..0b493cfe10 100644 --- a/docs/api/commands/shadow.mdx +++ b/docs/api/commands/shadow.mdx @@ -96,7 +96,7 @@ When working with `cy.click()`, it sometimes won't click the right element in Chrome. It's happening because of [the ambiguity in spec](https://bugs.chromium.org/p/chromium/issues/detail?id=1188919&q=shadowRoot%20elementFromPoint&can=2). -In this case, pass `'top` to `cy.click()` like below: +In this case, pass `'top'` to `cy.click()` like below: ```js cy.get('#element') From 7a421e095fb1fab7e531abcb8c43675729265f4c Mon Sep 17 00:00:00 2001 From: Matthew Sbar Date: Tue, 8 Apr 2025 17:14:31 -0500 Subject: [PATCH 3/3] Update shadow.mdx One-line for prettier reasons --- docs/api/commands/shadow.mdx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/api/commands/shadow.mdx b/docs/api/commands/shadow.mdx index 0b493cfe10..0939952aa0 100644 --- a/docs/api/commands/shadow.mdx +++ b/docs/api/commands/shadow.mdx @@ -99,10 +99,7 @@ Chrome. It's happening because of In this case, pass `'top'` to `cy.click()` like below: ```js -cy.get('#element') - .shadow() - .find('[data-test-id="my-button"]') - .click('top') +cy.get('#element').shadow().find('[data-test-id="my-button"]').click('top') ``` ## Command Log