mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-12-01 14:03:45 +03:00
Ignore invalid key codes for isChar
This commit is contained in:
parent
fdb8cf9c89
commit
6ec039b5df
|
@ -14,7 +14,16 @@
|
||||||
if (typeof evt.which == "undefined") {
|
if (typeof evt.which == "undefined") {
|
||||||
return true;
|
return true;
|
||||||
} else if (typeof evt.which == "number" && evt.which > 0) {
|
} else if (typeof evt.which == "number" && evt.which > 0) {
|
||||||
return !evt.ctrlKey && !evt.metaKey && !evt.altKey && evt.which != 8 && evt.which != 9;
|
return !evt.ctrlKey
|
||||||
|
&& !evt.metaKey
|
||||||
|
&& !evt.altKey
|
||||||
|
&& evt.which != 8 // backspace
|
||||||
|
&& evt.which != 9 // tab
|
||||||
|
&& evt.which != 13 // enter
|
||||||
|
&& evt.which != 16 // shift
|
||||||
|
&& evt.which != 17 // ctrl
|
||||||
|
&& evt.which != 20 // caps lock
|
||||||
|
&& evt.which != 27; // escape
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user