primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.85k stars 1.24k forks source link

DynamicForm: DatePicker (range) not working #6780

Open raizdev opened 1 week ago

raizdev commented 1 week ago

Describe the bug

I am receiving the following error while trying to set range datepicker in dynamic form.

const fields = reactive({
  date: {
    label: 'Datum',
    as: 'DatePicker',
    selectionMode: 'range',
    schema: z.array(),
  },
});

Attachted example https://stackblitz.com/edit/kcjndv?file=src%2FApp.vue

[Vue warn]: Unhandled error during execution of component update at <DatePicker id=undefined name="date" class="w-full" ... > at <DynamicFormControl ref_for=true as="DatePicker" selectionMode="range" ... > at at at <Form initialValues= {name: '', date: ''} resolver=fn onSubmit=fn ... > at <DynamicForm fields= {name: {…}, date: {…}} onSubmit=fn > at <BaseTransition onEnter=fn onAfterEnter=fn onBeforeLeave=fn ... > at <Transition name="p-drawer" onEnter=fn onAfterEnter=fn ... > at at <Drawer visible=true onUpdate:visible=fn header="Werkmap toevoegen" ... > at at <AppLayout onVnodeUnmounted=fn ref=Ref< Proxy(Object) {__v_skip: true} > > at at warn$1 @ runtime-core.esm-bundler.js:51 logError @ runtime-core.esm-bundler.js:263 handleError @ runtime-core.esm-bundler.js:255 callWithErrorHandling @ runtime-core.esm-bundler.js:201 flushJobs @ runtime-core.esm-bundler.js:408 Promise.then queueFlush @ runtime-core.esm-bundler.js:322 queueJob @ runtime-core.esm-bundler.js:317 baseWatchOptions.scheduler @ runtime-core.esm-bundler.js:6168 effect2.scheduler @ reactivity.esm-bundler.js:1826 trigger @ reactivity.esm-bundler.js:250 endBatch @ reactivity.esm-bundler.js:308 trigger @ reactivity.esm-bundler.js:721 set @ reactivity.esm-bundler.js:1003 set @ runtime-core.esm-bundler.js:3110 writeValue @ BaseEditableHolder.vue:81 updateModel @ DatePicker.vue:1238 selectDate @ DatePicker.vue:1226 onDateSelect @ DatePicker.vue:1162 onClick @ DatePicker.vue:230 callWithErrorHandling @ runtime-core.esm-bundler.js:199 callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:206 invoker @ runtime-dom.esm-bundler.js:722 Show 22 more frames Show less DatePickerStyle.js:457 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0') at day (DatePickerStyle.js:457:60) at resolve (resolve.ts:4:30) at getKeyValue (getKeyValue.ts:9:48) at Proxy._getOptionValue (BaseComponent.vue:212:20) at Proxy.cx (BaseComponent.vue:300:44) at DatePicker.vue:229:63 at renderList (runtime-core.esm-bundler.js:2867:16) at DatePicker.vue:255:49 at renderList (runtime-core.esm-bundler.js:2867:16) at DatePicker.vue:256:45

Reproducer

https://stackblitz.com/edit/kcjndv?file=src%2FApp.vue

PrimeVue version

4.1.2

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response