diff --git a/app/components/malio/input/InputAmount.vue b/app/components/malio/input/InputAmount.vue index d8806ae..fd9bf9d 100644 --- a/app/components/malio/input/InputAmount.vue +++ b/app/components/malio/input/InputAmount.vue @@ -201,7 +201,7 @@ const onInput = (event: Event) => { // maxLength borne la longueur du MODÈLE (pas l'affichage) : on ignore le keystroke en dépassement. if (props.maxLength != null && model.length > Number(props.maxLength)) { target.value = formattedValue.value - const restored = Math.max(0, caret - 1) + const restored = Math.min(Math.max(0, caret - 1), formattedValue.value.length) target.setSelectionRange(restored, restored) return }