title: cy.clear() not clearing input field properly - Cypress
body: <p>When I perform</p>
  
  <pre><code>cy.get('#fsp-name').clear().type('random text');
  </code></pre>
  
  <p>If the text already has value lets say 'assd asd adsdsd' and I perform above command I get something similar to 'random textassd'</p>
  
  <p>I also tried using</p>
  
  <pre><code>cy.get('#fsp-name').clear().should('have.value', '').type('random text');
  </code></pre>
  
  <p>It works some time and in other times it complains it does not equal to ' '.</p>
  
  <p>And I am trying to do this in a each loop like below</p>
  
  <pre><code>const data = [
  {selector:'#name', newValue: 'John'},
  {selector:'#phone', newValue: '1234567'}
  ];
  cy.wrap(data).each(field =&gt; {
  cy.get(field.selector).clear().should('have.value', '').type(field.newValue);
  cy.contains('Save').click();
  cy.visit('/abc/sdd');
  cy.get(field.selector).invoke('val').should('equal', field.newValue);
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/64A63.png" rel="noreferrer"><img src="https://i.stack.imgur.com/64A63.png" alt="enter image description here"></a></p>