Bug 34497: (QA follow-up):Fix required text field

input.value can be either null (if flatpickr date field empty) or '' (if simple text input empty),
so account for both situations.
Add missing 'required' attribute to text inputs.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-10-20 14:35:26 +00:00 committed by Tomas Cohen Arazi
parent 4416a6ed35
commit 84268b66ae
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -38,6 +38,7 @@
v-if="input.type == 'Text'"
:id="`confirmation_input_${input.id}`"
v-model="input.value"
:required="input.required"
/>
</div>
</div>
@ -87,7 +88,9 @@ export default {
if (
this.confirmation.inputs &&
this.confirmation.inputs.filter(
input => input.required && input.value == null
input =>
input.required &&
(input.value == null || input.value == "")
).length
) {
this.$refs.confirmationform.reportValidity()