material-web icon indicating copy to clipboard operation
material-web copied to clipboard

Input component with type="datetime-local" and step="1" behaves wrong

Open whiteancient opened this issue 1 year ago • 2 comments

What is affected?

Component

Description

The hour-selector in an input with type="datetime-local" and step="1" does not allow to write a 2 digit number with the keyboard.

Reproduction

Here is a Gist that does not work. https://lit.dev/playground/#gist=3eedd3e52aa191e027d059e26869ff5e

I does work for some users, but not all. I have customers complaining about the behavior.

hours_00_2x

Workaround

The workaround is to use the keyboard up/down to change the digit to its right value

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

Current

Browser/OS/Node environment

Browser: Chrome and Edge OS: Windows

whiteancient avatar Sep 08 '24 07:09 whiteancient

What timezone and locale are you in that is giving the unexpected behavior?

Entering in "October 10, 2025 @ 10:10:10am" works for me, but I'm in GMT-7 on en-US, so my inputs take a different format.

Screenshot 2024-09-09 at 9 09 14 AM

I don't see an am/pm section in your input, so I think it may be a different 24-hour locale that behaves differently.

asyncliz avatar Sep 09 '24 16:09 asyncliz

I am in Sweden with sv-SE as my locale., Timezone right now is GMT+2 here.

whiteancient avatar Sep 11 '24 17:09 whiteancient