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

improve validDate rule ans set it by default #3681

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

VachetVirginie
Copy link
Contributor

@VachetVirginie VachetVirginie commented Aug 2, 2024

Description

Si la date est invalide le message d'erreur s'affiche bien mais le submit n'est pas bloque

Playground

<script setup lang="ts">
import {DatePicker, notAfterToday, required, notBeforeToday} from '@/main'
import {SubmitEventPromise} from "vuetify";
import { ref } from 'vue'

const date = ref(null)

async function submitForm(event: SubmitEventPromise): Promise<void> {
	const submitResult = await event
	if (submitResult.valid) {
		alert("valid")
	}
}
</script>

<template>
	<v-form
		@submit.prevent="submitForm"
	>
		<DatePicker v-model="date" :rules="[notAfterToday, required]" :warning-rules="[notBeforeToday]"  label="NotAfterToday"/>

		<button type="submit">Rechercher</button>
	</v-form>
</template>

@VachetVirginie VachetVirginie force-pushed the bugfix/invalid-date-rule branch from 552c409 to a06d2c5 Compare August 2, 2024 11:28
@VachetVirginie VachetVirginie force-pushed the bugfix/invalid-date-rule branch from d766c77 to 647744f Compare August 2, 2024 13:18
@DavidFyon DavidFyon merged commit 9b0987e into v2-bridge Aug 2, 2024
2 checks passed
@DavidFyon DavidFyon deleted the bugfix/invalid-date-rule branch August 2, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants