Skip to content

Commit

Permalink
get rid of depricated api (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMoiseev authored Nov 24, 2023
1 parent 857e40e commit 65a4845
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!/localhost/.test(document.location.host)) {
export class AppComponent {
keyDown(e) {
const event = e.event;
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion JSDemos/Demos/NumberBox/Overview/AngularJS/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DemoApp.controller('DemoController', ($scope) => {
},
onKeyDown(e) {
const { event } = e;
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
3 changes: 1 addition & 2 deletions JSDemos/Demos/NumberBox/Overview/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const stockLabel = { 'aria-label': 'Stock' };

const keyDown = (e: NumberBoxTypes.KeyDownEvent) => {
const { event } = e;
// eslint-disable-next-line deprecation/deprecation
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
3 changes: 1 addition & 2 deletions JSDemos/Demos/NumberBox/Overview/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const salesLabel = { 'aria-label': 'Sales' };
const stockLabel = { 'aria-label': 'Stock' };
const keyDown = (e) => {
const { event } = e;
// eslint-disable-next-line deprecation/deprecation
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion JSDemos/Demos/NumberBox/Overview/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const max = 30;
function keyDown(e) {
const { event } = e;
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion JSDemos/Demos/NumberBox/Overview/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $(() => {
inputAttr: { 'aria-label': 'Sales' },
onKeyDown(e) {
const { event } = e;
const str = event.key || String.fromCharCode(event.which);
const str = event.key;
if (/^[.,e]$/.test(str)) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion MVCDemos/Views/NumberBox/Overview.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
function key_down(e) {
var event = e.jQueryEvent,
str = event.key || String.fromCharCode(event.which);
str = event.key;
if(/^[.,e]$/.test(str)) {
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion NetCoreDemos/Views/NumberBox/Overview.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
function key_down(e) {
var event = e.event,
str = event.key || String.fromCharCode(event.which);
str = event.key;
if(/^[.,e]$/.test(str)) {
event.preventDefault();
Expand Down

0 comments on commit 65a4845

Please sign in to comment.