use dedicated container div for tippy.js
This commit is contained in:
parent
24e2819acb
commit
34c0c7ddab
3 changed files with 32 additions and 20 deletions
|
|
@ -38,10 +38,10 @@ import {
|
|||
} from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
import FileIcon from "../FileIcon";
|
||||
import SafeImg from "../SafeImg";
|
||||
import AddDocsDialog from "../dialogs/AddDocsDialog";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
import { ComboBoxItem, ComboBoxItemType } from "./types";
|
||||
|
||||
const ICONS_FOR_DROPDOWN: { [key: string]: any } = {
|
||||
|
|
@ -120,7 +120,7 @@ const ItemsDiv = styled.div`
|
|||
overflow-y: auto;
|
||||
max-height: 330px;
|
||||
padding: 0.2rem;
|
||||
position: relative;
|
||||
position: relative; // absolute to test tippy.js bug
|
||||
|
||||
background-color: ${vscQuickInputBackground};
|
||||
/* backdrop-filter: blur(12px); */
|
||||
|
|
@ -352,7 +352,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
}, [allItems]);
|
||||
|
||||
return (
|
||||
<ItemsDiv className="items-container">
|
||||
<ItemsDiv>
|
||||
{querySubmenuItem ? (
|
||||
<QueryInput
|
||||
rows={1}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import Text from "@tiptap/extension-text";
|
|||
import { Plugin } from "@tiptap/pm/state";
|
||||
import { Editor, EditorContent, JSONContent, useEditor } from "@tiptap/react";
|
||||
import { ContextProviderDescription, InputModifiers } from "core";
|
||||
import { rifWithContentsToContextItem } from "core/commands/util";
|
||||
import { modelSupportsImages } from "core/llm/autodetect";
|
||||
import { debounce } from "lodash";
|
||||
import { usePostHog } from "posthog-js/react";
|
||||
|
|
@ -34,7 +35,22 @@ import { useInputHistory } from "../../hooks/useInputHistory";
|
|||
import useIsOSREnabled from "../../hooks/useIsOSREnabled";
|
||||
import useUpdatingRef from "../../hooks/useUpdatingRef";
|
||||
import { useWebviewListener } from "../../hooks/useWebviewListener";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { selectUseActiveFile } from "../../redux/selectors";
|
||||
import { selectDefaultModel } from "../../redux/slices/configSlice";
|
||||
import {
|
||||
addCodeToEdit,
|
||||
clearCodeToEdit,
|
||||
selectHasCodeToEdit,
|
||||
selectIsInEditMode,
|
||||
setMainEditorContentTrigger,
|
||||
} from "../../redux/slices/sessionSlice";
|
||||
import { exitEditMode } from "../../redux/thunks";
|
||||
import {
|
||||
loadLastSession,
|
||||
loadSession,
|
||||
saveCurrentSession,
|
||||
} from "../../redux/thunks/session";
|
||||
import {
|
||||
getFontSize,
|
||||
isJetBrains,
|
||||
|
|
@ -55,22 +71,6 @@ import {
|
|||
handleVSCMetaKeyIssues,
|
||||
} from "./handleMetaKeyIssues";
|
||||
import { ComboBoxItem } from "./types";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { selectDefaultModel } from "../../redux/slices/configSlice";
|
||||
import {
|
||||
addCodeToEdit,
|
||||
clearCodeToEdit,
|
||||
selectHasCodeToEdit,
|
||||
selectIsInEditMode,
|
||||
setMainEditorContentTrigger,
|
||||
} from "../../redux/slices/sessionSlice";
|
||||
import { exitEditMode } from "../../redux/thunks";
|
||||
import {
|
||||
loadLastSession,
|
||||
loadSession,
|
||||
saveCurrentSession,
|
||||
} from "../../redux/thunks/session";
|
||||
import { rifWithContentsToContextItem } from "core/commands/util";
|
||||
|
||||
const InputBoxDiv = styled.div<{ border?: string }>`
|
||||
resize: none;
|
||||
|
|
@ -986,6 +986,12 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
<HoverTextDiv>Hold ⇧ to drop image</HoverTextDiv>
|
||||
</>
|
||||
)}
|
||||
<div
|
||||
id="tippy-js-div"
|
||||
style={{
|
||||
position: "fixed",
|
||||
}}
|
||||
/>
|
||||
</InputBoxDiv>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,15 @@ function getSuggestion(
|
|||
return;
|
||||
}
|
||||
|
||||
const container = document.getElementById("tippy-js-div");
|
||||
if (!container) {
|
||||
console.log("no container");
|
||||
return;
|
||||
}
|
||||
|
||||
popup = tippy("body", {
|
||||
getReferenceClientRect: props.clientRect,
|
||||
appendTo: () => document.body,
|
||||
appendTo: () => container,
|
||||
content: component.element,
|
||||
showOnCreate: true,
|
||||
interactive: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue