🐛 fix: bug fixed

This commit is contained in:
Paul Valerie GOMA 2025-07-22 10:08:04 +02:00
parent 66cb7aa8a3
commit 121780cebe

View File

@ -165,8 +165,8 @@ const labelState = computed(() => {
v-bind="attrs"
:class="[styles['text-body-MD-standard-text-Regular'], {
'p-inputtext': true,
'error': props.isInvalid && !props.isValid && !props.disabled,
'success': !props.isInvalid && props.isValid && !props.disabled,
'error': props.isInvalid && !props.isValid && !props.disabled || !!props.errorMessage,
'success': !props.isInvalid && props.isValid && !props.disabled && !props.errorMessage,
}]"
:disabled="props.disabled"
:aria-disabled="props.disabled"
@ -180,7 +180,7 @@ const labelState = computed(() => {
role="alert"
aria-live="polite"
>
<template v-if="Array.isArray(props.errorMessage)">
<template v-if="Array.isArray(props.errorMessage) && props.isInvalid">
<VHint
v-for="message in props.errorMessage"
:id="descriptionId"
@ -192,7 +192,7 @@ const labelState = computed(() => {
/>
</template>
<VHint
v-else-if="errorMessage"
v-else-if="errorMessage && props.isInvalid"
:id="descriptionId"
:key="`error-${errorMessage}`"
:data-testid="descriptionId"
@ -200,7 +200,7 @@ const labelState = computed(() => {
type="alert"
icon
/>
<template v-if="Array.isArray(props.validMessage)">
<template v-if="Array.isArray(props.validMessage) && props.isValid">
<VHint
v-for="message in props.validMessage"
:id="descriptionId"
@ -212,7 +212,7 @@ const labelState = computed(() => {
/>
</template>
<VHint
v-else-if="validMessage"
v-else-if="validMessage && props.isValid"
:id="descriptionId"
:key="`error-${validMessage}`"
:data-testid="descriptionId"