Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation does not kick in range mode with text input #837

Closed
dvuckovic opened this issue Apr 17, 2024 · 0 comments
Closed

Validation does not kick in range mode with text input #837

dvuckovic opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dvuckovic
Copy link

Describe the bug
When the datepicker is running in range mode with text input enabled, the emitted value can be set to an invalid range (i.e. the start date is after the end date).

To Reproduce
Steps to reproduce the behavior in this Playground:

  1. Focus the input field
  2. Enter an invalid range in form of start and end date, i.e. 2024-04-17 - 2024-04-01
  3. Press Enter key (or click Select button in the overlay)
  4. Confirm that the emitted value contains an invalid range (the start date is after the end date).

Expected behavior
The datepicker should not emit an invalid range, but possibly clear it.

Screenshots

Screenshot 2024-04-17 at 11 57 52

Desktop & mobile (please complete the following information):

  • Browser: Firefox
  • Library version: 8.4.0

Playground:

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

<template>
  <div>
    <Datepicker
      v-model="date"
      :enable-time-picker="false"
      model-type="yyyy-MM-dd"
      format="yyyy-MM-dd"
      range
      text-input
    />
    <pre>{{ date }}</pre>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import Datepicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';

const date = ref();
</script>
@dvuckovic dvuckovic added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels Apr 17, 2024
@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants