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

Calendar: Error if using datatype string with selectionMode="range" and keepInvalid=true #12722

Closed
jase88 opened this issue Mar 8, 2023 · 0 comments · Fixed by #13524
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@jase88
Copy link
Contributor

jase88 commented Mar 8, 2023

Describe the bug

The error

ERROR TypeError: this.value.map is not a function

occurs if using Calendar component with the above mentioned properties and typing an invalid string into the input field.

example:

  <p-calendar
  [showOnFocus]="false"
  [readonlyInput]="false"
  [showIcon]="true"
  [keepInvalid]="true"
  selectionMode="range"
  dateFormat="dd.mm.yy"
  dataType="string"
></p-calendar>

Environment

Windows 10 x64
Chrome 110.0.5481.104 64bit

Reproducer

https://stackblitz.com/edit/github-erwier?file=src/app/app.component.ts

Angular version

15.2.1

PrimeNG version

15.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.14.0

Browser(s)

Chrome 110.0.5481.104 64bit

Steps to reproduce the behavior

  1. click into the calendar input
  2. type some letters like "abc"
  3. look at the console
  4. additionally click the calendar icon for another error

Expected behavior

No error thrown if changing the value although invalid

@jase88 jase88 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 8, 2023
mertsincan pushed a commit that referenced this issue Aug 26, 2023
…nMode="range" and keepInvalid=true (#13524)

* fix: error where value is assumed to be an array, but is a string because keepInvalid property is set

* fix: start and end value being strings instead of date instances

* fix: start and end value being strings instead of date instances

* fix: error where value is assumed to be an array, but is a string because keepInvalid property is set
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 26, 2023
@mertsincan mertsincan added this to the 16.2.1 milestone Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
2 participants