From f47ed403cf89eb961b89a8021a469e505f81f5c2 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Tue, 7 Jan 2025 16:22:26 +0100 Subject: [PATCH] Focus input when clicking in a chat, on a non focussable element --- packages/jupyter-chat/src/widgets/chat-widget.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-chat/src/widgets/chat-widget.tsx b/packages/jupyter-chat/src/widgets/chat-widget.tsx index a1a9aa2..da62d2d 100644 --- a/packages/jupyter-chat/src/widgets/chat-widget.tsx +++ b/packages/jupyter-chat/src/widgets/chat-widget.tsx @@ -14,11 +14,12 @@ export class ChatWidget extends ReactWidget { constructor(options: Chat.IOptions) { super(); - this.id = 'jupyter-chat::widget'; this.title.icon = chatIcon; this.title.caption = 'Jupyter Chat'; // TODO: i18n this._chatOptions = options; + this.id = `jupyter-chat::widget::${options.model.name}`; + this.node.onclick = () => this.model.focusInput(); } /**