Cannot type into a datetime-local input field
See original GitHub issueCurrent behavior:
The input field doesn’t update with a value when you type in text
Desired behavior:
The value should appear in the input
How to reproduce:
Test code:
Typescript:
cy.get("input[type='datetime-local']").type("1");
Additional Info (images, stack traces, etc)
I can see from the log it correctly “yields” the input element. It just doesn’t visually display anything in the input box (when the type command executes).
- Operating System: Win 10
- Cypress Version: 2.0.3
- Browser Version: Chrome 64
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Bind an input with type datetime-local to a Date property in ...
Demo Plnkr. You can bind to a date using the following format: yyyy-MM-ddTHH:mm , which you can also get from date.toISOString().slice(0,16) (the slice ......
Read more ><input type="datetime-local"> - HTML - MDN Web Docs
One thing the datetime-local input type doesn't provide is a way to set the time zone and/or locale of the date/time control. This...
Read more >HTML Input Types - W3Schools
Here are the different input types you can use in HTML: ... <input type="text"> defines a single-line text input field: ... Input Type...
Read more >Text field - Shopify Polaris
A text field is an input field that merchants can type into. It has a range of options and supports several text formats...
Read more >Anyone using input fields of type "datetime-local"? How to get ...
I'd love to use <input type="datetime-local" in my Elm app, but the output of that field seems to be of the form “YYYY-MM-DDTHH:MM”, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cypressProj I am going to make a wild guess here, and assume you use ReactJS. I had the same issue you described. I figured that this was caused by React, because we are using React controlled inputs.
This Stackoverflow answer pointed me in the right direction: https://stackoverflow.com/a/46012210/1221091
My code:
support/setDate.js
And then I use it like this:
This was pretty frustrating to fix, but I managed to come up with the following work around that played nicely with redux form.