Skip to content

Commit

Permalink
chat box is now selected by class name
Browse files Browse the repository at this point in the history
  • Loading branch information
robGardiner01 committed Aug 7, 2024
1 parent e8a737e commit 4c977f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class GooeyEmbedFactory {
}
const innerDiv = document.createElement("div");
innerDiv.style.display = "contents";
innerDiv.className = "inner-div";
if(targetElem.children.length > 0) targetElem.removeChild(targetElem.children[0]);
targetElem.appendChild(innerDiv);
const root = renderCopilotChatWidget(innerDiv, config);
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/copilot/components/widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CopilotWidget: FC<CopilotWidgetType> = ({ isInline }) => {
const handleEditClick = () => {
cancelApiCall();
flushData();
const shadowRoot = document.getElementById(isInline ? "inline" : "popup")?.firstElementChild?.shadowRoot;
const shadowRoot = document.getElementById(isInline ? "inline" : "popup")?.getElementsByClassName("inner-div")[0]?.shadowRoot;
const ele = shadowRoot?.getElementById(CHAT_INPUT_ID);
ele?.focus();
};
Expand Down

0 comments on commit 4c977f9

Please sign in to comment.