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

Fix issues with cy.type #2016

Merged
merged 16 commits into from
Jul 23, 2018
Merged

Fix issues with cy.type #2016

merged 16 commits into from
Jul 23, 2018

Conversation

kuceb
Copy link
Contributor

@kuceb kuceb commented Jun 22, 2018

this grew to a large PR fixing many cy.type issues.

fix #365
fix #420
fix #586
fix #593
fix #596
fix #651
fix #940
fix #1002
fix #1108
fix #1171
fix #1209
fix #1234
fix #1366
fix #1381
fix #1684
fix #1686
fix #1926
fix #2056
fix #2096
fix #2110
fix #2173
fix #2187
fix #2233

@@ -199,6 +203,11 @@ module.exports = (Commands, Cypress, cy, state, config) ->
if domEvents.mouseDown.preventedDefault or not $dom.isAttached($elToClick)
afterMouseDown($elToClick, coords)
else
if $elements.isInput(el) or $elements.isTextarea(el) or $elements.isContentEditable(el)
if $elements.isNeedSingleValueChangeInputElement(el)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot tell what this means from its name 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lord, read the comments - maybe...this...is...fine... 😳

@kuceb kuceb changed the title WIP: fix caret position on cy.type with contenteditable Fix issues with cy.type Jul 14, 2018
@kuceb kuceb mentioned this pull request Jul 16, 2018
@kuceb kuceb self-assigned this Jul 17, 2018
@kuceb kuceb added this to the 3.0.3 milestone Jul 17, 2018
@brian-mann brian-mann merged commit 9f28aea into develop Jul 23, 2018
@phoet
Copy link

phoet commented Jun 25, 2019

i might have found another issue when usinig min and max fields on an input[type=number]. since i'm in the middle of a refactoring and upgrading cypress did not help, i'm currently working around this issue with a custom command:

Cypress.Commands.add('replace', { prevSubject: true }, (subject, value) => {
  // only relyable way to replace the content without scrambling the value (adding min or max)
  cy.wrap(subject).clear({ force: true });
  cy.wrap(subject).clear({ force: true }).type(value);
});

@kuceb
Copy link
Contributor Author

kuceb commented Jun 25, 2019

@phoet could you open an issue or add your comment to one of the related issues? merged PRs are not very visible. Thanks

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.