app-extension-qdatetimepicker icon indicating copy to clipboard operation
app-extension-qdatetimepicker copied to clipboard

[v2] Model not revalidated in displayValue mode

Open Maia-Everett opened this issue 3 years ago • 0 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.

Maia-Everett avatar Nov 15 '21 07:11 Maia-Everett