material-components / material-web

Material Design Web Components
https://material-web.dev
Apache License 2.0
9.2k stars 877 forks source link

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

Open whiteancient opened 1 week ago

whiteancient commented 1 week ago

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

asyncLiz commented 1 week ago

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.

whiteancient commented 1 week ago

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