fix: fix type for clientRect

This commit is contained in:
Philipp Kühn
2021-04-16 23:33:30 +02:00
parent 61c9e794b4
commit 07c6d51338

View File

@@ -36,7 +36,7 @@ export interface SuggestionProps {
items: any[],
command: (props: any) => void,
decorationNode: Element | null,
clientRect: () => (DOMRect | null),
clientRect: (() => DOMRect) | null,
}
export interface SuggestionKeyDownProps {
@@ -103,7 +103,9 @@ export function Suggestion({
decorationNode,
// virtual node for popper.js or tippy.js
// this can be used for building popups without a DOM node
clientRect: () => decorationNode?.getBoundingClientRect() || null,
clientRect: decorationNode
? () => decorationNode.getBoundingClientRect()
: null,
}
if (handleExit) {