Skip to content

Range Error when removing colon from Time Input in IE #2012

Closed
@TheStantonator

Description

@TheStantonator

In browsers that don't support the input="time" control such as IE and Safari, the user is presented with a textbox instead that they can edit. If they change this textbox to remove the colon, the control will be replaced with a "RangeError: Invalid time value" with no other option that to refresh the page.

Steps to reproduce the behavior:

  1. Go to https://reactdatepicker.com/#example-input-time in internet explorer
  2. In the textbox, change the value to remove the colon
  3. See error

I propose that instead of throwing an error, the control checks that the inputted value is valid before it tries to convert it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions