Skip to content

Commit 94916c0

Browse files
authored
Revert "Defer updating screen reader content when not in a11y mode" (microsoft#167829)
Fixes microsoft#165821: Revert "Defer updating screen reader content when not in a11y mode" This reverts commit ffe90c3.
1 parent 040964a commit 94916c0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/vs/editor/browser/controller/textAreaHandler.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor
3434
import { TokenizationRegistry } from 'vs/editor/common/languages';
3535
import { ColorId, ITokenPresentation } from 'vs/editor/common/encodedTokenAttributes';
3636
import { Color } from 'vs/base/common/color';
37-
import { TimeoutTimer } from 'vs/base/common/async';
3837
import { IME } from 'vs/base/common/ime';
3938

4039
export interface IVisibleRangeProvider {
@@ -114,7 +113,6 @@ export class TextAreaHandler extends ViewPart {
114113

115114
private _accessibilitySupport!: AccessibilitySupport;
116115
private _accessibilityPageSize!: number;
117-
private _accessibilityWriteTimer: TimeoutTimer;
118116
private _textAreaWrapping!: boolean;
119117
private _textAreaWidth!: number;
120118
private _contentLeft: number;
@@ -154,7 +152,6 @@ export class TextAreaHandler extends ViewPart {
154152
const layoutInfo = options.get(EditorOption.layoutInfo);
155153

156154
this._setAccessibilityOptions(options);
157-
this._accessibilityWriteTimer = this._register(new TimeoutTimer());
158155
this._contentLeft = layoutInfo.contentLeft;
159156
this._contentWidth = layoutInfo.contentWidth;
160157
this._contentHeight = layoutInfo.height;
@@ -610,11 +607,9 @@ export class TextAreaHandler extends ViewPart {
610607
public override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {
611608
this._selections = e.selections.slice(0);
612609
this._modelSelections = e.modelSelections.slice(0);
613-
if (this._accessibilitySupport === AccessibilitySupport.Disabled) {
614-
this._accessibilityWriteTimer.cancelAndSet(() => this._textAreaInput.writeScreenReaderContent('selection changed'), 0);
615-
} else {
616-
this._textAreaInput.writeScreenReaderContent('selection changed');
617-
}
610+
// We must update the <textarea> synchronously, otherwise long press IME on macos breaks.
611+
// See https://github.com/microsoft/vscode/issues/165821
612+
this._textAreaInput.writeScreenReaderContent('selection changed');
618613
return true;
619614
}
620615
public override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {

0 commit comments

Comments
 (0)