Skip to content

Commit 0cca31e

Browse files
authored
[WIKI-707] [WIKI-708] fix: editor floating ui modal (#7909)
1 parent 4c8f515 commit 0cca31e

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

packages/editor/src/core/components/menus/block-menu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ export const BlockMenu = (props: Props) => {
206206
...floatingStyles,
207207
animationFillMode: "forwards",
208208
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)", // Expo ease out
209+
zIndex: 100,
209210
}}
210211
className={cn(
211-
"z-20 max-h-60 min-w-[7rem] overflow-y-scroll rounded-lg border border-custom-border-200 bg-custom-background-100 p-1.5 shadow-custom-shadow-rg",
212+
"max-h-60 min-w-[7rem] overflow-y-scroll rounded-lg border border-custom-border-200 bg-custom-background-100 p-1.5 shadow-custom-shadow-rg",
212213
"transition-all duration-300 transform origin-top-right",
213214
isAnimatedIn ? "opacity-100 scale-100" : "opacity-0 scale-75"
214215
)}

packages/editor/src/core/extensions/mentions/mentions-list-dropdown.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ export const MentionsListDropdown = forwardRef((props: MentionsListDropdownProps
115115
<div
116116
ref={commandListContainer}
117117
className="z-10 max-h-[90vh] w-[14rem] overflow-y-auto rounded-md border-[0.5px] border-custom-border-300 bg-custom-background-100 px-2 py-2.5 shadow-custom-shadow-rg space-y-2"
118+
onClick={(e) => {
119+
e.stopPropagation();
120+
}}
121+
onMouseDown={(e) => {
122+
e.stopPropagation();
123+
}}
118124
>
119125
{isLoading ? (
120126
<div className="text-center text-sm text-custom-text-400">Loading...</div>
@@ -138,6 +144,7 @@ export const MentionsListDropdown = forwardRef((props: MentionsListDropdownProps
138144
)}
139145
onClick={(e) => {
140146
e.preventDefault();
147+
e.stopPropagation();
141148
selectItem(sectionIndex, itemIndex);
142149
}}
143150
onMouseEnter={() =>

packages/editor/src/core/extensions/mentions/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const renderMentionsDropdown =
3131
const element = component.element as HTMLElement;
3232
element.style.position = "absolute";
3333
element.style.zIndex = "100";
34+
3435
document.body.appendChild(element);
3536
updateFloatingUIFloaterPosition(props.editor, element);
3637
},

0 commit comments

Comments
 (0)