Skip to content

Commit

Permalink
Merge pull request #3572 from continuedev/pe/bugfix-mentionlist-z-index
Browse files Browse the repository at this point in the history
bugfix(GUI): increase z-index on tippy mentionlist
  • Loading branch information
Patrick-Erichsen authored Dec 30, 2024
2 parents 442a88f + 2a14450 commit 5251852
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 7 additions & 10 deletions gui/src/components/mainInput/TipTapEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ interface TipTapEditorProps {
historyKey: string;
}

export const TIPPY_DIV_ID = "tippy-js-div";

function TipTapEditor(props: TipTapEditorProps) {
const dispatch = useAppDispatch();

Expand Down Expand Up @@ -990,22 +992,17 @@ function TipTapEditor(props: TipTapEditorProps) {

{showDragOverMsg &&
modelSupportsImages(
defaultModel.provider,
defaultModel.model,
defaultModel.title,
defaultModel.capabilities,
defaultModel?.provider || "",
defaultModel?.model || "",
defaultModel?.title,
defaultModel?.capabilities,
) && (
<>
<HoverDiv></HoverDiv>
<HoverTextDiv>Hold ⇧ to drop image</HoverTextDiv>
</>
)}
<div
id="tippy-js-div"
style={{
position: "fixed",
}}
/>
<div id={TIPPY_DIV_ID} className="fixed z-50" />
</InputBoxDiv>
);
}
Expand Down
4 changes: 3 additions & 1 deletion gui/src/components/mainInput/getSuggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import tippy from "tippy.js";
import { IIdeMessenger } from "../../context/IdeMessenger";
import MentionList from "./MentionList";
import { ComboBoxItem, ComboBoxItemType, ComboBoxSubAction } from "./types";
import { TIPPY_DIV_ID } from "./TipTapEditor";

function getSuggestion(
items: (props: { query: string }) => Promise<ComboBoxItem[]>,
Expand Down Expand Up @@ -37,7 +38,8 @@ function getSuggestion(
return;
}

const container = document.getElementById("tippy-js-div");
const container = document.getElementById(TIPPY_DIV_ID);

if (!container) {
console.log("no container");
return;
Expand Down

0 comments on commit 5251852

Please sign in to comment.