TobyMosque / app-extension-qdatetimepicker

QDateTimePicker for Quasar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[v2] Model not revalidated in displayValue mode

Maia-Everett opened this issue · comments

To reproduce:

  • Insert a QDateTimePicker into a QForm.
  • Set both the displayValue and rules props, for example, like this, with displayValue being a function of the model value:
<q-date-time-picker
  label="Start date/time"
  v-model="startDateTime"
  :display-value="startDateTime"
  mode="datetime"
  :rules="[
    (val) => !!val || 'This field is required.',
  ]"
/>
  • Click the date/time picker field.
  • Select a date/time and click Set.
  • Observe that the "This field is required" validation error is not cleared upon setting the value.

As a workaround, I've added a watcher that hides the date/time picker and immediately shows it again upon value change, causing it to re-render and clear validation errors.

Reproduced with @toby.mosque/quasar-ui-qdatetimepicker version 2.0.0-rc3.