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 authored and anish-work committed Aug 12, 2024
1 parent 02eb726 commit bfa12a1
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 bfa12a1

Please sign in to comment.