mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
fix: 🐛 Fix bugs with mentions picker
This commit is contained in:
parent
f0516cb58a
commit
87b6377264
|
|
@ -57,9 +57,9 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error Tippy types are wrong
|
// @ts-expect-error Tippy types are wrong
|
||||||
popup = tippy("body", {
|
popup = tippy(props.editor.options.element, {
|
||||||
getReferenceClientRect: props.clientRect,
|
getReferenceClientRect: props.clientRect,
|
||||||
appendTo: () => document.body,
|
appendTo: () => props.editor.options.element,
|
||||||
content: component.element,
|
content: component.element,
|
||||||
showOnCreate: true,
|
showOnCreate: true,
|
||||||
interactive: true,
|
interactive: true,
|
||||||
|
|
@ -75,14 +75,14 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
popup[0]?.setProps({
|
popup.setProps({
|
||||||
getReferenceClientRect: props.clientRect as () => DOMRect,
|
getReferenceClientRect: props.clientRect as () => DOMRect,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown(props) {
|
onKeyDown(props) {
|
||||||
if (props.event.key === "Escape") {
|
if (props.event.key === "Escape") {
|
||||||
popup[0]?.hide();
|
popup.hide();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
onExit() {
|
onExit() {
|
||||||
popup[0]?.destroy();
|
popup.hide();
|
||||||
|
popup.destroy();
|
||||||
component.destroy();
|
component.destroy();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue