@@ -32,7 +32,7 @@ import { IChatReplyFollowup } from 'vs/workbench/contrib/chat/common/chatService
32
32
import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/chatWidgetHistoryService' ;
33
33
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution' ;
34
34
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
35
- import { isWindows } from 'vs/base/common/platform' ;
35
+ import { isMacintosh } from 'vs/base/common/platform' ;
36
36
37
37
const $ = dom . $ ;
38
38
@@ -153,21 +153,24 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
153
153
this . history . add ( editorValue ) ;
154
154
}
155
155
156
+ if ( this . accessibilityService . isScreenReaderOptimized ( ) && isMacintosh ) {
157
+ this . _acceptInputForVoiceover ( ) ;
158
+ } else {
159
+ this . _inputEditor . focus ( ) ;
160
+ this . _inputEditor . setValue ( '' ) ;
161
+ }
162
+ }
163
+
164
+ private _acceptInputForVoiceover ( ) : void {
156
165
const domNode = this . _inputEditor . getDomNode ( ) ;
157
166
if ( ! domNode ) {
158
167
return ;
159
168
}
160
- // Remove the input editor from the DOM temporarily to avoid the screen reader
161
- // from reading the cleared text (the request) to the user. On Windows, we don't need to do this
162
- // and it could cause issues.
163
- const handleDom = this . accessibilityService . isScreenReaderOptimized ( ) && ! isWindows ;
164
- if ( handleDom ) {
165
- this . _inputEditorElement . removeChild ( domNode ) ;
166
- }
169
+ // Remove the input editor from the DOM temporarily to prevent VoiceOver
170
+ // from reading the cleared text (the request) to the user.
171
+ this . _inputEditorElement . removeChild ( domNode ) ;
167
172
this . _inputEditor . setValue ( '' ) ;
168
- if ( handleDom ) {
169
- this . _inputEditorElement . appendChild ( domNode ) ;
170
- }
173
+ this . _inputEditorElement . appendChild ( domNode ) ;
171
174
this . _inputEditor . focus ( ) ;
172
175
}
173
176
0 commit comments