diff --git a/docs/api/actions/scrollintoview.mdx b/docs/api/actions/scrollintoview.mdx index 3a2731455b..a93db1ffe1 100644 --- a/docs/api/actions/scrollintoview.mdx +++ b/docs/api/actions/scrollintoview.mdx @@ -55,7 +55,8 @@ Pass in an options object to change the default behavior of `.scrollIntoView()`. ### Scrolling ```javascript -cy.get('button#checkout').scrollIntoView().should('be.visible') +cy.get('button#checkout').scrollIntoView() +cy.get('button#checkout').should('be.visible') ``` ### Options @@ -111,7 +112,8 @@ or #### Assert element is visible after scrolling it into view ```javascript -cy.get('#scroll-horizontal button').scrollIntoView().should('be.visible') +cy.get('#scroll-horizontal button').scrollIntoView() +cy.get('#scroll-horizontal button').should('be.visible') ``` The commands above will display in the Command Log as: