-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Closed
Copy link
Labels
type: regressionA bug that didn't appear until a specific Cy version releaseA bug that didn't appear until a specific Cy version releasev3.5.0 🐛Issue present since 3.5.0Issue present since 3.5.0
Description
Current behavior:
Typing a modifier key into an input anywhere removes selected text in an active input.
Desired behavior:
Shouldn't touch input value at all.
Steps to reproduce: (app code and test code)
describe('test', () => {
it('test', () => {
cy.document().then(doc => {
doc.body.innerHTML = `
<textarea class="one">hello</textarea>
<textarea class="two">hello</textarea>
<input class="three" value="hello">
`;
});
// (1) clears whole textarea
cy.get('.one').type('{selectall}').type('{ctrl}');
// (2) clears whole textarea
cy.get('.two').type('{selectall}');
cy.get('body').type('{ctrl}');
// (3) removes last letter
cy.get('.three')
.focus()
.then( $input => {
$input[0].selectionStart = 4;
$input[0].selectionEnd = 5;
})
.type('{ctrl}');
});
});Versions
- Cypress
3.5.0, Win 7, chrome stable 77 (headed) & chrome canary 73 (headless) - It's possible a regression in older cypress version (I've migrated from
3.3.1→3.5.0directly)
Metadata
Metadata
Assignees
Labels
type: regressionA bug that didn't appear until a specific Cy version releaseA bug that didn't appear until a specific Cy version releasev3.5.0 🐛Issue present since 3.5.0Issue present since 3.5.0