Cancel keydown events when not in screenReaderMode

This caused issues with embedder keybinding systems firing when they
shouldn't be. The fix is to only allow it in screenReaderMode as a
compromise so keys are echoed.
This commit is contained in:
Daniel Imms
2019-07-25 10:08:41 -07:00
parent 52c562d4b1
commit 7479131747
+10 -1
View File
@@ -1568,10 +1568,19 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
this.textarea.value = '';
}
this._keyDownHandled = true;
this._onKey.fire({ key: result.key, domEvent: event });
this.showCursor();
this._coreService.triggerDataEvent(result.key, true);
// Cancel events when not in screen reader mode so events don't get bubbled up and handled by
// other listeners. When screen reader mode is enabled, this could cause issues if the event
// is handled at a higher level, this is a compromise in order to echo keys to the screen
// reader.
if (!this.optionsService.options.screenReaderMode) {
return this.cancel(event, true);
}
this._keyDownHandled = true;
}
private _isThirdLevelShift(browser: IBrowser, ev: IKeyboardEvent): boolean {