I'm trying to make my IMask
input update its value to be cleared when it is clicked but IMask
is throwing a warning:
Element value has changed outside the mask. Sync the mask using mask.updateValue() for it to work correctly.
I've tried to use all of the ways I could find to update the value, such as mask.updateValue()
though I still see the error.
import IMask from "imask";
import {contador} from "./lib/contador";
import {NewGame} from "./lib/novoJogo";
import {SorteioNumero} from "./lib/sorteioDoNumero";
let input = document.querySelector("#number");
const mask = IMask(input, {
mask: Number,
min: 0,
max: 10,
});
input.addEventListener("click", () => {
input.value = "";
mask.updateValue();
});