@@ -32,7 +32,7 @@ import { IChatReplyFollowup } from 'vs/workbench/contrib/chat/common/chatService
3232import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/chatWidgetHistoryService' ;
3333import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution' ;
3434import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
35- import { isWindows } from 'vs/base/common/platform' ;
35+ import { isMacintosh } from 'vs/base/common/platform' ;
3636
3737const $ = dom . $ ;
3838
@@ -153,21 +153,24 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
153153 this . history . add ( editorValue ) ;
154154 }
155155
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 {
156165 const domNode = this . _inputEditor . getDomNode ( ) ;
157166 if ( ! domNode ) {
158167 return ;
159168 }
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 ) ;
167172 this . _inputEditor . setValue ( '' ) ;
168- if ( handleDom ) {
169- this . _inputEditorElement . appendChild ( domNode ) ;
170- }
173+ this . _inputEditorElement . appendChild ( domNode ) ;
171174 this . _inputEditor . focus ( ) ;
172175 }
173176
0 commit comments