Year auto padding issue on keyboard input

Author: kangelSLCreated Jul 15, 2026Updated Jul 16, 2026

When the keyboard is used to delete a year value, the blur event auto populates it to an incorrect value.

To Reproduce Steps to reproduce the behavior:

  1. Select a valid date value e.g. 15/07/2026
  2. Delete a single digit from the input using the keyboard e.g. 15/07/202
  3. Click out to fire the blur event

Expected behavior

The date input clears the value entirely as it is invalid

Actual behaviour

The date blur event pads out the date to 15/07/0202. This puts in an incorrect value if the user accidentally leaves a date incomplete when using the keyboard

Desktop (please complete the following information):

  • OS: Windows
  • Browser - Chrome but likely replicable in any browser
  • Version - 9.1.0 version of datepicker

Source: Hacker0x01/react-datepicker