diff --git a/docs/api/commands/blur.mdx b/docs/api/commands/blur.mdx index 36c264f26f..5f2c49bf8c 100644 --- a/docs/api/commands/blur.mdx +++ b/docs/api/commands/blur.mdx @@ -74,7 +74,8 @@ Pass in an options object to change the default behavior of `.blur`. #### Blur the comment input ```javascript -cy.get('[name="comment"]').type('Nice Product!').blur() +cy.get('[name="comment"]').type('Nice Product!') +cy.get('[name="comment"]').blur() ``` ### Options @@ -140,7 +141,9 @@ events. Your best bet here is to keep Cypress focused when working on a test. **_Blur a textarea after typing._** ```javascript -cy.get('[name="comment"]').focus().type('Nice Product!').blur() +cy.get('[name="comment"]').focus() +cy.get('[name="comment"]').type('Nice Product!') +cy.get('[name="comment"]').blur() ``` The commands above will display in the Command Log as: diff --git a/docs/api/commands/clear.mdx b/docs/api/commands/clear.mdx index 83e9e7a09c..6b1a5c62a2 100644 --- a/docs/api/commands/clear.mdx +++ b/docs/api/commands/clear.mdx @@ -33,7 +33,8 @@ An alias for [`.type('{selectall}{del}')`](/api/commands/type) ```javascript cy.get('[type="text"]').clear() // Clear text input -cy.get('textarea').type('Hi!').clear() // Clear textarea +cy.get('textarea').type('Hi!') +cy.get('textarea').clear() // Clear textarea cy.focused().clear() // Clear focused input/textarea ``` @@ -73,7 +74,8 @@ Pass in an options object to change the default behavior of `.clear()`. #### Clear the input and type a new value ```javascript -cy.get('textarea').clear().type('Hello, World') +cy.get('textarea').clear() +cy.get('textarea').type('Hello, World') ``` ## Notes @@ -117,7 +119,8 @@ Please read the [`.type()`](/api/commands/type) documentation for more details. **_Clear the input and type a new value_** ```javascript -cy.get('input[name="name"]').clear().type('Jane Lane') +cy.get('input[name="name"]').clear() +cy.get('input[name="name"]').type('Jane Lane') ``` The commands above will display in the Command Log as: diff --git a/docs/api/commands/focus.mdx b/docs/api/commands/focus.mdx index bf1f67c959..90364c6dc0 100644 --- a/docs/api/commands/focus.mdx +++ b/docs/api/commands/focus.mdx @@ -65,8 +65,9 @@ cy.get('[type="input"]').focus() #### Focus, type, and blur a textarea ```javascript -// yields the