fix tippy position
This commit is contained in:
@@ -50,7 +50,7 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
popup = tippy('body', {
|
popup = tippy('body', {
|
||||||
getReferenceClientRect: () => props.clientRect,
|
getReferenceClientRect: props.clientRect,
|
||||||
appendTo: () => document.body,
|
appendTo: () => document.body,
|
||||||
content: component.element,
|
content: component.element,
|
||||||
showOnCreate: true,
|
showOnCreate: true,
|
||||||
@@ -63,7 +63,7 @@ export default {
|
|||||||
component.updateProps(props)
|
component.updateProps(props)
|
||||||
|
|
||||||
popup[0].setProps({
|
popup[0].setProps({
|
||||||
getReferenceClientRect: () => props.clientRect,
|
getReferenceClientRect: props.clientRect,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onKeyDown(props) {
|
onKeyDown(props) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export interface SuggestionProps {
|
|||||||
items: any[],
|
items: any[],
|
||||||
command: (attributes: AnyObject) => void,
|
command: (attributes: AnyObject) => void,
|
||||||
decorationNode: Element | null,
|
decorationNode: Element | null,
|
||||||
clientRect: DOMRect | null,
|
clientRect: () => (DOMRect | null),
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SuggestionKeyDownProps {
|
export interface SuggestionKeyDownProps {
|
||||||
@@ -98,7 +98,7 @@ export function Suggestion({
|
|||||||
decorationNode,
|
decorationNode,
|
||||||
// virtual node for popper.js or tippy.js
|
// virtual node for popper.js or tippy.js
|
||||||
// this can be used for building popups without a DOM node
|
// this can be used for building popups without a DOM node
|
||||||
clientRect: decorationNode?.getBoundingClientRect() || null,
|
clientRect: () => decorationNode?.getBoundingClientRect() || null,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handleStart) {
|
if (handleStart) {
|
||||||
|
|||||||
Reference in New Issue
Block a user