replace charCode as it is deprecated

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode

Co-authored-by: mvdbeek <m.vandenbeek@gmail.com>
This commit is contained in:
Ahmed Awan
2025-03-10 12:39:58 +01:00
committed by mvdbeek
co-authored by mvdbeek
parent e14bf799cc
commit df5faa3f14
@@ -150,10 +150,10 @@ export default {
this.dismissCountDown = this.dismissSecs;
}
},
/** To only allow numbers and decimal points as input for this number field */
isNumberOrDecimal(event) {
// NOTE: Should we check for `fieldType` here?
const charCode = event.charCode;
if ((charCode >= 48 && charCode <= 57) || charCode === 46) {
const key = event.key;
if ((key >= "0" && key <= "9") || key === ".") {
return true;
}
event.preventDefault();