mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-02-16 18:31:50 +01:00
Avoid recursion in Alt check on Firefox
The Firefox workaround which checks for missing Alt key events may synthesise new KeyboardEvents. On these events, checkAlt should not be recursively triggered. Otherwise, we get "too much recursion" errors whenever the Alt key is pressed.
This commit is contained in:
parent
5b73c1ca23
commit
d4747a8c80
@ -301,6 +301,9 @@ export default class Keyboard {
|
||||
|
||||
// Firefox Alt workaround, see below
|
||||
_checkAlt(e) {
|
||||
if (e.skipCheckAlt) {
|
||||
return;
|
||||
}
|
||||
if (e.altKey) {
|
||||
return;
|
||||
}
|
||||
@ -315,6 +318,7 @@ export default class Keyboard {
|
||||
const event = new KeyboardEvent('keyup',
|
||||
{ key: downList[code],
|
||||
code: code });
|
||||
event.skipCheckAlt = true;
|
||||
target.dispatchEvent(event);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user