Closed dehbini closed 1 year ago
That was my fault. I solve the issue by breaking bind:value.
<input type="tel" name="mobile" id="mobile" placeholder="09xxxxx xx xx" value={$mobile.value} on:input={transformMobile} />
const transformMobile = (event: InputEvent) => {
const input = event.target as HTMLInputElement;
$mobile.value = convertNumberToEnglish(input.value);
};
Hello, I have an input that get the user's mobile number, I want to change the value of mobile before it's validated on change. For example if the user's keyboard is in Arabic, I want to convert what user is typing to English.
I already tried below code, this will update the value (the value shows in English chars), but $mobile.valid is still false. It seems that the update of the value happens after the validation. Any idea how to solve this issue?