Skip to content

Commit c50533b

Browse files
authored
Focus on welcome message container for experimental view after rendering (#255888)
Find the correct chat widget before setting input on click (#255877) * Find the correct chat widget before setting input on click * fix: update chat widget input handling to focus on the correct widget
1 parent 70bdf31 commit c50533b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,14 @@ export class ChatViewWelcomePart extends Disposable {
203203
suggestedPrompt: prompt.prompt,
204204
});
205205

206-
this.chatWidgetService.lastFocusedWidget?.focusInput();
207-
this.chatWidgetService.lastFocusedWidget?.setInput(prompt.prompt);
206+
if (!this.chatWidgetService.lastFocusedWidget) {
207+
const widgets = this.chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Panel);
208+
if (widgets.length) {
209+
widgets[0].setInput(prompt.prompt);
210+
}
211+
} else {
212+
this.chatWidgetService.lastFocusedWidget.setInput(prompt.prompt);
213+
}
208214
}));
209215
}
210216
}

0 commit comments

Comments
 (0)