Merge pull request #1280 from jalfd/alt-key-recursion

Avoid recursion in Alt check on Firefox
This commit is contained in:
Samuel Mannehed 2019-09-24 15:56:13 +02:00 committed by GitHub
commit ebb58c34da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -301,6 +301,9 @@ export default class Keyboard {
// Firefox Alt workaround, see below // Firefox Alt workaround, see below
_checkAlt(e) { _checkAlt(e) {
if (e.skipCheckAlt) {
return;
}
if (e.altKey) { if (e.altKey) {
return; return;
} }
@ -315,6 +318,7 @@ export default class Keyboard {
const event = new KeyboardEvent('keyup', const event = new KeyboardEvent('keyup',
{ key: downList[code], { key: downList[code],
code: code }); code: code });
event.skipCheckAlt = true;
target.dispatchEvent(event); target.dispatchEvent(event);
}); });
} }