Git Product home page Git Product logo

Comments (10)

thevladisss avatar thevladisss commented on June 27, 2024

Can I collaborate in resolving this bug?

from cypress.

Abdillah avatar Abdillah commented on June 27, 2024

Sure @thevladisss.

At initial discovery, this part seems the one responsible.

from cypress.

thevladisss avatar thevladisss commented on June 27, 2024

@Abdillah I spent some time investigating this issue and it appears like your issue is quite natural, as under the hood it calls "stepUp" and "stepDown" on input type number. This method does not trigger any event on the input, unlilke clicking arrows on input type number.

@jennifer-shehane I think that {upArrow} actually implies that user clicks up arrow key, which does trigger events on the input, as it is same as clicking on the arrows. Do you beleive I can work on implementing this behavior?

from cypress.

Abdillah avatar Abdillah commented on June 27, 2024

Yes, that is spot on.

That doesn't match with user expectation using Cypress for real world arrow up behavior.
I believe it can be improved.

from cypress.

thevladisss avatar thevladisss commented on June 27, 2024

@jennifer-shehane Can I start working on this?

from cypress.

Abdillah avatar Abdillah commented on June 27, 2024

Arrow up can be simulated using the following way (a work around).

const arrowDown = $el => {
    const v = parseInt($el.val())++
    cy.wrap($el).type('{selectAll}' + v)
}

const arrowDown = $el => {
    const v = parseInt($el.val())--
    cy.wrap($el).type('{selectAll}' + v)
}

cy.get('input[type=number]').then(arrowUp)
cy.get('input[type=number]').then(arrowDown)

Edited: use .type() instead of val()

from cypress.

thevladisss avatar thevladisss commented on June 27, 2024

Arrow up can be simulated using the following way (a work around).

const arrowUp = $el => $el.val($e.val()++)

const arrowDown = $el => $el.val($e.val()--)



cy.get('input[type=number]').then(arrowUp)

cy.get('input[type=number]').then(arrowDown)

I think there should be a solution rather than workaround. There is certain specific behaviour about type number that cannot be just covered by adding value unfortunately

from cypress.

Abdillah avatar Abdillah commented on June 27, 2024

@thevladisss Actually, Cypress team has considered this as a bug, you can just create a PR and request them for review rather than waiting for them (they have lots of issue to triage). Currently I'm not available to tackle this issue but need to get things done, hence the workaround.

from cypress.

Abdillah avatar Abdillah commented on June 27, 2024

If you need some discussion, @thevladisss, you can throw it here. I can be your second brain.

from cypress.

thevladisss avatar thevladisss commented on June 27, 2024

If you need some discussion, @thevladisss, you can throw it here. I can be your second brain.

Thanks! Once I get something I will comeback here.

from cypress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.