primevue icon indicating copy to clipboard operation
primevue copied to clipboard

Calendar: Calendar navigates to wrong month on UnSelect

Open TomSmith27 opened this issue 1 year ago • 1 comments

Describe the bug

When you have multiple days selected on a Calendar, if you unselect a date it will always navigate to the month with the last value in the array.

To reproduce use multiple mode and Select a date in every month, Unselect a middle month and notice it will then navigate you to the wrong month, i don't think it should move the user on "unselect"

    <Calendar
      inline
      v-model="value"
      selectionMode="multiple"
      :manualInput="false"
    />

This is the line that is causing the behaviour https://github.com/primefaces/primevue/blob/da2038e248af8f55a40236c748bc73feba57064a/components/lib/calendar/Calendar.vue#L2717

Reproducer

https://stackblitz.com/edit/angular-qvm9mg-uv63sh?file=src%2FApp.vue

PrimeVue version

3.30.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

All

Steps to reproduce the behavior

To reproduce use multiple mode and Select a date in every month, Unselect a middle month and notice it will then navigate you to the wrong month, i don't think it should move the user on "unselect"

Expected behavior

I think when unselecting a date it shouldn't do anything

TomSmith27 avatar Oct 11 '23 15:10 TomSmith27

Not sure if this is really a bug. Some people might like the behavior. But in our team we also were surprised and would rather have the option to stay on the same page when deselecting a date. If it is clear, how this should be resolved, we could actually contribute here.

fabiandarga avatar Jan 30 '24 13:01 fabiandarga