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

aciccarello opened this Issue Nov 7, 2018 · 4 comments


3 participants
Copy link

aciccarello commented Nov 7, 2018

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.


Tested on Cypress 3.1.0


This comment has been minimized.

Copy link

jennifer-shehane commented Nov 14, 2018

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


@lilaconlee lilaconlee added this to the Sprint 12 milestone Nov 20, 2018

chrisbreiding added a commit that referenced this issue Nov 20, 2018

Add clear support for HTML 5 input types (#2793)
- Fixes #2738 

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

This comment has been minimized.

Copy link

lilaconlee commented Nov 20, 2018

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


This comment has been minimized.

Copy link

aciccarello commented Mar 5, 2019

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


This comment has been minimized.

Copy link

jennifer-shehane commented Mar 6, 2019

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
You can’t perform that action at this time.