aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/settings/Key.ts2
-rw-r--r--test/shared/settings/Key.test.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/settings/Key.ts b/src/shared/settings/Key.ts
index cfe1e7e..1464e57 100644
--- a/src/shared/settings/Key.ts
+++ b/src/shared/settings/Key.ts
@@ -60,7 +60,7 @@ export default class Key {
}
isDigit(): boolean {
- return digits.includes(this.key);
+ return digits.includes(this.key) && !this.ctrl && !this.alt && !this.meta;
}
equals(key: Key) {
diff --git a/test/shared/settings/Key.test.ts b/test/shared/settings/Key.test.ts
index 3a1c86e..b8538f8 100644
--- a/test/shared/settings/Key.test.ts
+++ b/test/shared/settings/Key.test.ts
@@ -80,7 +80,7 @@ describe("Key", () => {
it('returns true if the key is a digit', () => {
expect(new Key({ key: '0' }).isDigit()).to.be.true;
expect(new Key({ key: '9' }).isDigit()).to.be.true;
- expect(new Key({ key: '9', shift: true }).isDigit()).to.be.true;
+ expect(new Key({ key: '9', alt: true }).isDigit()).to.be.false;
expect(new Key({ key: 'a' }).isDigit()).to.be.false;
expect(new Key({ key: '0' }).isDigit()).to.be.false;