mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user