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

[Bug Report][3.3.0] Error messages aren't shown if set from external source #17420

Closed
lioneaglesolutions opened this issue May 22, 2023 · 4 comments
Assignees
Labels
C: VInput T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke
Milestone

Comments

@lioneaglesolutions
Copy link
Collaborator

Environment

Vuetify Version: 3.3.0
Last working version: 3.2.5
Vue Version: 3.3.4
Browsers: Chrome 113.0.0.0
OS: Mac OS 10.15.7

Steps to reproduce

Set error-messages to a value from some external source - in the repro, simply click the button to emulate errors being set from another service such as vee-validate.

Input is in error state but messages not shown.

Expected Behavior

Error messages to show without having to blur the input

Actual Behavior

Error messages don't show unless the input is blurred

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

Example in docs also doesn't work

https://vuetifyjs.com/en/components/forms/#vee-validate

@lioneaglesolutions
Copy link
Collaborator Author

lioneaglesolutions commented May 22, 2023

Likely caused by d1da47a#diff-bfb7e69738bb67211b49b47bbdcf5f9fa724199beab1b517d39d217d128de235

If error-messages is not empty, error messages should always be displayed IMO - regardless of whether the value is pristine or not

@lioneaglesolutions lioneaglesolutions added T: bug Functionality that does not work as intended/expected C: VInput and removed S: triage labels May 22, 2023
@lioneaglesolutions
Copy link
Collaborator Author

Another workaround is to validate the form onMount;

<template>
  <v-form v-bind="$attrs" ref="form">
    <slot />
  </v-form>
</template>

<script lang="ts" setup>
import { VForm } from "vuetify/lib/components/index.mjs";

defineEmits(["submit"]);
const form = ref<VForm>();

// TODO - this should be removed when issue resolved
onMounted(() => {
  form.value?.validate();
});
</script>

@KaelWD
Copy link
Member

KaelWD commented May 22, 2023

Yeah the problem is there's currently no distinction between errorMessages from rules and explicit props.errorMessages

@KaelWD KaelWD added the T: regression Something that used to work but we broke label May 22, 2023
@KaelWD KaelWD added this to the v3.3.x milestone May 22, 2023
@KaelWD KaelWD self-assigned this May 23, 2023
@KaelWD KaelWD closed this as completed in 1740693 May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VInput T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke
Projects
None yet
Development

No branches or pull requests

2 participants