Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Feb 2, 2023
1 parent dfcd674 commit d5b5f1a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/browser/AccessibilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ const MAX_ROWS_TO_READ = 20;

export class AccessibilityManager extends Disposable {
private _accessibilityContainer: HTMLElement;
private _liveRegion: HTMLElement;
private _liveRegionLineCount: number = 0;
private _accessiblityBuffer: HTMLElement;

private _renderRowsDebouncer: IRenderDebouncer;

private _isAccessibilityBufferActive: boolean = false;
public get isAccessibilityBufferActive(): boolean { return this._isAccessibilityBufferActive; }
private _liveRegion: HTMLElement;
private _liveRegionLineCount: number = 0;
private _liveRegionDebouncer: IRenderDebouncer;

/**
* This queue has a character pushed to it for keys that are pressed, if the
Expand All @@ -39,6 +36,9 @@ export class AccessibilityManager extends Disposable {

private _charsToAnnounce: string = '';

private _isAccessibilityBufferActive: boolean = false;
public get isAccessibilityBufferActive(): boolean { return this._isAccessibilityBufferActive; }

constructor(
private readonly _terminal: ITerminal,
@IOptionsService optionsService: IOptionsService,
Expand All @@ -53,7 +53,7 @@ export class AccessibilityManager extends Disposable {
this._liveRegion.classList.add('live-region');
this._liveRegion.setAttribute('aria-live', 'assertive');
this._accessibilityContainer.appendChild(this._liveRegion);
this._renderRowsDebouncer = this.register(new TimeBasedDebouncer(this._announceCharacters.bind(this)));
this._liveRegionDebouncer = this.register(new TimeBasedDebouncer(this._announceCharacters.bind(this)));

if (!this._terminal.element) {
throw new Error('Cannot enable accessibility before Terminal.open');
Expand All @@ -77,7 +77,7 @@ export class AccessibilityManager extends Disposable {
}));


this.register(this._renderRowsDebouncer);
this.register(this._liveRegionDebouncer);
this.register(this._terminal.onRender(e => this._refreshRows(e.start, e.end)));
this.register(this._terminal.onScroll(() => this._refreshRows()));
// Line feed is an issue as the prompt won't be read out after a command is run
Expand Down Expand Up @@ -153,7 +153,7 @@ export class AccessibilityManager extends Disposable {
}

private _refreshRows(start?: number, end?: number): void {
this._renderRowsDebouncer.refresh(start, end, this._terminal.rows);
this._liveRegionDebouncer.refresh(start, end, this._terminal.rows);
}

private _refreshRowDimensions(element: HTMLElement): void {
Expand Down

0 comments on commit d5b5f1a

Please sign in to comment.