Skip to content

Datepicker throws exception since v4.4.0 when change from range to single selectionMode #8214

@stephanestermann

Description

@stephanestermann

Describe the bug

The datepicker throws an exception since version v4.x when you switch from selectionMode "range" to "single".
With version 3.3.9 the provided stackblitz work.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-cnatytb4?file=src%2FApp.vue,package.json

Environment

Ubuntu 24.04.3 LTS
Firefox, Chrome...
PrimeVue since version 4.4.x

Vue version

3.5.22

PrimeVue version

4.4.x

Node version

v22.20.0

Browser(s)

No response

Steps to reproduce the behavior

Scenario 1 (Exception happen):

1: Click in the datepicker filed and chose a daterange
2: open the debugger console
3: click the button "change selection mode"
4: there's thrown an exception in the console
5: click on the datepicker input. The datepicker don't work anymore because the unhandled exception

Scenario 2 (No exception happen):

1: click directly the button "change selection mode"
2: no exception is thrown in the console
3: click on the datepicker input. The datepicker does work an the datepicker is in single mode

Expected behavior

  • Theres no exception thrown
  • the datepicker is in single mode
  • the visible date is the new single date

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions