Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5.0-3.6.1 regression - cy.type() may skip a character on a autofocussing textbox #5703

Closed
lukeapage opened this issue Nov 14, 2019 · 4 comments · Fixed by #5809 or #5854 · May be fixed by ngChile/ngx-devkit-cypress-builder#20 or qsays/grafana#1
Closed
Assignees
Labels
topic: cy.type ⌨️ type: regression v3.5.0 🐛

Comments

@lukeapage
Copy link
Contributor

@lukeapage lukeapage commented Nov 14, 2019

Current behavior:

When typing '10' into a textbox with text selected and that text is '1', the textbox doesn't lose the selection upon typing the first '1' so when the '0' is typed the textbox ends up with '0' but if a user types it, we get '10'

Steps to reproduce: (app code and test code)

cypress-io/cypress-test-tiny#54

Versions

3.6.1, windows

@Bkucera I guess this is a regression from your type() changes.

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Nov 27, 2019

I have verified this fails in an unexpected ways in both 3.5.0 and 3.6.1 (in different ways). I also verified this is not fixed in 3.7.0 pre-release.

index.html

<html>
<body>
  <input type="text" value="1" />
</body>
<script>
  const el = document.getElementsByTagName('input')[0];
  el.addEventListener('focus', (ev) => ev.target.select());
</script>
</html>

spec.js

it('works', () => {
  cy.visit(`index.html`);
  cy.get('input').type('10');
  cy.get('input').should('have.value', '10');
})

3.4.1

Types in 10 as expected

3.5.0

Types in 110

3.6.1

Types in 1 which is then replaced with 0.

@cypress-bot cypress-bot bot added the stage: ready for work label Nov 27, 2019
@jennifer-shehane jennifer-shehane added type: regression and removed stage: ready for work labels Nov 27, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review and removed stage: work in progress stage: needs review labels Nov 27, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: work in progress labels Nov 27, 2019
@flotwig flotwig reopened this Nov 27, 2019
@cypress-io cypress-io deleted a comment from cypress-bot bot Nov 27, 2019
@cypress-bot cypress-bot bot added stage: needs review and removed stage: pending release labels Dec 3, 2019
@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Dec 3, 2019

There is a PR open to fix this here: #5854 Our initial attempt at a fix broke some other behavior, so this is the latest.

@cypress-bot cypress-bot bot added the stage: pending release label Dec 3, 2019
@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Dec 3, 2019

The code for this is done in cypress-io/cypress#5854, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review label Dec 3, 2019
@jennifer-shehane jennifer-shehane added the v3.5.0 🐛 label Dec 10, 2019
@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Dec 12, 2019

Released in 3.8.0.

@cypress-bot cypress-bot bot removed the stage: pending release label Dec 12, 2019
@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.