Skip to content

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

Open

Description

@whiteancient

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

Activity

  1. asyncliz commented on Sep 9, 2024

    @asyncliz
    Collaborator

    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.

  2. whiteancient commented on Sep 11, 2024

    @whiteancient
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions