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

Month range picker doesn't trigger rangeStart rangeEnd events properly #1005

Closed
jllavec opened this issue Sep 26, 2024 · 0 comments · Fixed by #1006
Closed

Month range picker doesn't trigger rangeStart rangeEnd events properly #1005

jllavec opened this issue Sep 26, 2024 · 0 comments · Fixed by #1006
Labels
bug Something isn't working

Comments

@jllavec
Copy link

jllavec commented Sep 26, 2024

Describe the bug
Hi,

When I'm using Month picker with range selection and I select first January 2023 and then February 2023, event flow works properly.

January 2023 triggers rangeStart and February 2023 triggers rangeEnd.

But when I select them in the opposite way it doesn't work properly.

If I select first February 2023, it triggers rangeStart and if I select then January 2023, it triggers rangeStart again but twice.
The first trigger I receive the date I selected as end of range, and in second trigger I receive as parameter the date i selected as start of range.

I don't think this is intended behavior, since with dates picker, it works properly in both ways.

To Reproduce

Repro stackblitz: https://stackblitz.com/edit/vuepic-vue-datepicker-b6kbyg?file=src%2Fcomponents%2FPlayground.vue
Steps to reproduce the behavior:

  1. Open datepicker as month picker (in repro stackblitz the first one)
  2. Select February 2024
  3. Check that rangeStart trigger worked properly
  4. Select January 2024
  5. Check that rangeEnd doesn't trigger but rangeStart triggers twice

Expected behavior
I expect that Month Picker triggers rangeStart and rangeEnd events without taking in count the order I select the dates (as it works in Dates Picker).
It should trigger rangeStart when I select the first date, and then rangeEnd when I select the other date for the range, regardless it's sooner or later than the first one I selected.

Screenshots
If applicable, add screenshots to help explain your problem.

Working properly selecting in order January-February
bien

Unexpected behavior selecting in opposite order February-January
mal

Desktop & mobile (please complete the following information):

  • Browser [e.g. chrome, safari]: Chrome 129.0.6668.70 / Firefox 130.0.1
  • Library version [e.g. 3.0.0]: 9.0.3
@jllavec jllavec added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels Sep 26, 2024
@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label Oct 9, 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

Successfully merging a pull request may close this issue.

2 participants