Skip to content

Commit

Permalink
Fix #3100: KeyFilter test using e.key (#3101)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jul 24, 2022
1 parent 106494b commit 0bc9ec3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/lib/keyfilter/KeyFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ export const KeyFilter = {
return;
}

const regex = this.getRegex(keyfilter);
const browser = DomHandler.getBrowser();

if (e.ctrlKey || e.altKey) {
return;
}

const browser = DomHandler.getBrowser();
const k = this.getKey(e);
if (browser.mozilla && (this.isNavKeyPress(e) || k === KeyFilter.KEYS.BACKSPACE || (k === KeyFilter.KEYS.DELETE && e.charCode === 0))) {
return;
Expand All @@ -87,7 +85,8 @@ export const KeyFilter = {
return;
}

if (!regex.test(cc)) {
const regex = this.getRegex(keyfilter);
if (!regex.test(e.key)) {
e.preventDefault();
}
},
Expand Down

0 comments on commit 0bc9ec3

Please sign in to comment.