fix(transport) : immatriculations LIOT — re-synchronise le champ après filtrage (:key) pour ne plus afficher les caractères interdits (ERP-193)
This commit is contained in:
@@ -30,8 +30,9 @@
|
||||
MalioInputText (inheritAttrs:false) renvoie `class` sur l'input. -->
|
||||
<div v-if="isLiot" class="col-span-2 xl:col-span-3">
|
||||
<MalioInputText
|
||||
:key="liotPlatesKey"
|
||||
:model-value="main.liotPlates"
|
||||
@update:model-value="(v: string) => main.liotPlates = sanitizeLiotPlates(v)"
|
||||
@update:model-value="onLiotPlatesInput"
|
||||
:label="t('transport.carriers.form.main.liotPlates')"
|
||||
:hint="t('transport.carriers.form.main.liotPlatesHint')"
|
||||
:required="true"
|
||||
@@ -370,6 +371,20 @@ function onIndexationInput(value: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
// Immatriculations LIOT : la clé force le ré-affichage quand le filtrage laisse le
|
||||
// modelValue inchangé (ex: caractère interdit seul tapé) — sinon le DOM garderait
|
||||
// le caractère parasite alors que le modèle est déjà propre.
|
||||
const liotPlatesKey = ref(0)
|
||||
|
||||
/** Saisie des immatriculations LIOT : filtre la saisie et re-synchronise si filtré. */
|
||||
function onLiotPlatesInput(value: string): void {
|
||||
const clean = sanitizeLiotPlates(value)
|
||||
main.liotPlates = clean
|
||||
if (clean !== value) {
|
||||
liotPlatesKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
function goBack(): void {
|
||||
router.push(`/carriers/${carrierId}`)
|
||||
}
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
`class` sur l'input interne, pas sur la cellule de grille. -->
|
||||
<div v-if="isLiot" class="col-span-2 xl:col-span-3">
|
||||
<MalioInputText
|
||||
:key="liotPlatesKey"
|
||||
:model-value="main.liotPlates"
|
||||
@update:model-value="(v: string) => main.liotPlates = sanitizeLiotPlates(v)"
|
||||
@update:model-value="onLiotPlatesInput"
|
||||
:label="t('transport.carriers.form.main.liotPlates')"
|
||||
:hint="t('transport.carriers.form.main.liotPlatesHint')"
|
||||
:required="true"
|
||||
@@ -579,6 +580,20 @@ function onIndexationInput(value: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
// Immatriculations LIOT : la clé force le ré-affichage quand le filtrage laisse le
|
||||
// modelValue inchangé (ex: caractère interdit seul tapé) — sinon le DOM garderait
|
||||
// le caractère parasite alors que le modèle est déjà propre.
|
||||
const liotPlatesKey = ref(0)
|
||||
|
||||
/** Saisie des immatriculations LIOT : filtre la saisie et re-synchronise si filtré. */
|
||||
function onLiotPlatesInput(value: string): void {
|
||||
const clean = sanitizeLiotPlates(value)
|
||||
main.liotPlates = clean
|
||||
if (clean !== value) {
|
||||
liotPlatesKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
/** Retour vers le repertoire transporteurs (fleche d'en-tete). */
|
||||
function goBack(): void {
|
||||
router.push('/carriers')
|
||||
|
||||
Reference in New Issue
Block a user