fix: fix type for clientRect
This commit is contained in:
@@ -36,7 +36,7 @@ export interface SuggestionProps {
|
|||||||
items: any[],
|
items: any[],
|
||||||
command: (props: any) => void,
|
command: (props: any) => void,
|
||||||
decorationNode: Element | null,
|
decorationNode: Element | null,
|
||||||
clientRect: () => (DOMRect | null),
|
clientRect: (() => DOMRect) | null,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SuggestionKeyDownProps {
|
export interface SuggestionKeyDownProps {
|
||||||
@@ -103,7 +103,9 @@ 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
|
||||||
|
? () => decorationNode.getBoundingClientRect()
|
||||||
|
: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handleExit) {
|
if (handleExit) {
|
||||||
|
|||||||
Reference in New Issue
Block a user