Skip to content

Fire invalid-date event when date outside min/max-date is entered through text input #971

Closed
@bonroyage

Description

@bonroyage

Is your feature request related to a problem? Please describe.

We have a datepicker that also has three additional (relevant) options enabled:

  • text input
  • min date
  • max date

Currently, if the user enters a date that is outside the constraints of min/max, the input simply resets back to its previously valid value. Even though the user wouldn't necessarily know the constraints of the input without opening the picker.

Describe the solution you'd like

I would like an event to be fired when a date is entered through text input that falls outside the constraints of the min-date and max-date. That way I can force the value to be shown in an input regardless of its invalid state, so that a validation error can be shown separately.

Describe alternatives you've considered

I have looked at the @invalid-date event, but this does not seem to fire in the above scenario.

Additional context

I forked the playground, so I hope that the link works like this. If you enter 01/01/2025, the field clears itself, but the @invalid-date event is not fired.

https://stackblitz.com/edit/vuepic-vue-datepicker-vjmbv7?file=src%2Fcomponents%2FPlayground.vue

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions