mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
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:
+10
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user