mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
This commit is contained in:
parent
29c5c52302
commit
791930308f
|
@ -147,6 +147,7 @@ export class TextAreaInput extends Disposable {
|
|||
private readonly _host: ITextAreaInputHost;
|
||||
private readonly _textArea: TextAreaWrapper;
|
||||
private readonly _asyncTriggerCut: RunOnceScheduler;
|
||||
private readonly _asyncFocusGainWriteScreenReaderContent: RunOnceScheduler;
|
||||
|
||||
private _textAreaState: TextAreaState;
|
||||
private _selectionChangeListener: IDisposable | null;
|
||||
|
@ -160,6 +161,7 @@ export class TextAreaInput extends Disposable {
|
|||
this._host = host;
|
||||
this._textArea = this._register(new TextAreaWrapper(textArea));
|
||||
this._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0));
|
||||
this._asyncFocusGainWriteScreenReaderContent = this._register(new RunOnceScheduler(() => this.writeScreenReaderContent('asyncFocusGain'), 0));
|
||||
|
||||
this._textAreaState = TextAreaState.EMPTY;
|
||||
this._selectionChangeListener = null;
|
||||
|
@ -359,7 +361,15 @@ export class TextAreaInput extends Disposable {
|
|||
}));
|
||||
|
||||
this._register(dom.addDisposableListener(textArea.domNode, 'focus', () => {
|
||||
const hadFocus = this._hasFocus;
|
||||
|
||||
this._setHasFocus(true);
|
||||
|
||||
if (browser.isSafari && !hadFocus && this._hasFocus) {
|
||||
// When "tabbing into" the textarea, immediately after dispatching the 'focus' event,
|
||||
// Safari will always move the selection at offset 0 in the textarea
|
||||
this._asyncFocusGainWriteScreenReaderContent.schedule();
|
||||
}
|
||||
}));
|
||||
this._register(dom.addDisposableListener(textArea.domNode, 'blur', () => {
|
||||
if (this._isDoingComposition) {
|
||||
|
|
Loading…
Reference in a new issue