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(fill): make fill work with date/time inputs #1676

Merged
merged 1 commit into from
Apr 7, 2020
Merged

fix(fill): make fill work with date/time inputs #1676

merged 1 commit into from
Apr 7, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Apr 6, 2020

fix(fill): make fill work with date/time inputs

Date/time inputs are locale-specific, and also do not work with insertText. We just set the value on them and emulate input/change events. Note that some browsers do not support these input types just yet.

References #1331.

@jperl
Copy link
Contributor

jperl commented Apr 6, 2020

Can you also make fill work for time inputs? They will likely suffer the same issue as #1331

@dgozman
Copy link
Contributor Author

dgozman commented Apr 6, 2020

Can you also make fill work for time, datetime, anddatetime-local inputs? They will likely suffer the same issue as #1331

I looked at them:

  • datetime is deprecated, and renders as text in Chromium;
  • time and datetime-local are very locale-specific. For example, they show AM/PM, which is not universal. They also heavily rewrite, e.g. 00:12 turns into 12:12, and 18:55 turns into 06:55. Typing 13:60 does all kinds of strange things. If we go this route, we better validate stuff, or just set the value.

@jperl
Copy link
Contributor

jperl commented Apr 6, 2020

Sorry tried to edit my response to just ask for time.

I agree datetime is deprecated, so not worth implementing and datetime-local is not supported on firefox or safari so it is probably not worth implementing either.

However time might be valuable, at least to set the value.

@dgozman dgozman changed the title fix(fill): make fill work with date inputs fix(fill): make fill work with date/time inputs Apr 6, 2020
@dgozman
Copy link
Contributor Author

dgozman commented Apr 6, 2020

Updated this to use a different approach.

Date/time inputs are locale-specific, and also do not work with insertText.
We just set the value on them and emulate input/change events.
Note that some browsers do not support these input types just yet.
@dgozman dgozman merged commit e683c08 into microsoft:master Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants