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

Support .clear() on date inputs #2738

Closed
aciccarello opened this issue Nov 7, 2018 · 4 comments
Closed

Support .clear() on date inputs #2738

aciccarello opened this issue Nov 7, 2018 · 4 comments
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory type: bug
Milestone

Comments

@aciccarello
Copy link

Using .clear() on a date field should clear the value rather than causing an error. This may affect other field types.

Related StackOverflow question

Current behavior:

The .clear() command is an alias for .type({selectall}{backspace}). However, typing in date fields is limited to strings matching the date format. This causes Cypress to throw an error.

CypressError: Typing into a date input with cy.type() requires a valid date with the format 'yyyy-MM-dd'. You passed: {selectall}{del}

Desired behavior:

The type command should allow {selectall}{del} for date inputs and clear the input value.

Versions

Tested on Cypress 3.1.0

@jennifer-shehane
Copy link
Member

Have confirmed, this does error when trying to clear a date field and it should not error.

    cy.get('input').type('2019-08-07')
    cy.get('input').clear()

@jennifer-shehane jennifer-shehane added type: bug pkg/driver This is due to an issue in the packages/driver directory labels Nov 14, 2018
@lilaconlee lilaconlee added this to the Sprint 12 milestone Nov 20, 2018
chrisbreiding pushed a commit that referenced this issue Nov 20, 2018
- Fixes #2738 

Think directly setting this value might overstep something that's happening in type, but not entirely sure.
@lilaconlee
Copy link
Contributor

This has been fixed and we'll update the issue and the changelog when it's released.

@aciccarello
Copy link
Author

@lilaconlee Look like this was released in 3.1.5 however I don't see that noted in the changelog.

@jennifer-shehane
Copy link
Member

Thanks @aciccarello, this was released in 3.1.5. The changelog has been updated to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory type: bug
Projects
None yet
Development

No branches or pull requests

3 participants