Skip to content

Commit

Permalink
fix: 🐛 Fix bugs with mentions picker
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Dec 25, 2024
1 parent f0516cb commit 87b6377
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/editor/suggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export default {
}

// @ts-expect-error Tippy types are wrong
popup = tippy("body", {
popup = tippy(props.editor.options.element, {
getReferenceClientRect: props.clientRect,
appendTo: () => document.body,
appendTo: () => props.editor.options.element,
content: component.element,
showOnCreate: true,
interactive: true,
Expand All @@ -75,14 +75,14 @@ export default {
return;
}

popup[0]?.setProps({
popup.setProps({
getReferenceClientRect: props.clientRect as () => DOMRect,
});
},

onKeyDown(props) {
if (props.event.key === "Escape") {
popup[0]?.hide();
popup.hide();

return true;
}
Expand All @@ -91,7 +91,8 @@ export default {
},

onExit() {
popup[0]?.destroy();
popup.hide();
popup.destroy();
component.destroy();
},
};
Expand Down

0 comments on commit 87b6377

Please sign in to comment.