Skip to content

Can't enter 12 or 0 for hours when AM is selected #147

@johnhyde

Description

@johnhyde

I'm using useState to get selectedDate and setSelectedDate and passing them to value and onChange. I'm using 12-hour time. When AM/PM is set to AM, I cannot type 0 or 12 into the hours field. If I type 0, the field will just be empty and display the placeholder. If I type 12, the field empties when I enter the 2 and it displays the placeholder. In both cases, onChange is not called when the field clears itself.

If I set the time to 12PM and then switch to AM, it works fine, but if it's already set to AM it doesn't work. If I unhide the native datetime picker I have a similar issue typing in there. But if I use the dropdown and select 12am it works fine.

I tried testing this out with just react-time-picker and I didn't run into this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions