type stricter
This commit is contained in:
parent
3a61ddaee7
commit
cfa53dccce
|
@ -12,8 +12,8 @@ export const mentionSuggestion = (users: User[]): Suggestion => ({
|
||||||
items: ({ query }) =>
|
items: ({ query }) =>
|
||||||
users.filter((u) => searchInAny(query, u.username, u.name)).slice(0, 5),
|
users.filter((u) => searchInAny(query, u.username, u.name)).slice(0, 5),
|
||||||
render: () => {
|
render: () => {
|
||||||
let component: any
|
let component: ReactRenderer
|
||||||
let popup: any
|
let popup: ReturnType<typeof tippy>
|
||||||
return {
|
return {
|
||||||
onStart: (props) => {
|
onStart: (props) => {
|
||||||
component = new ReactRenderer(MentionList, {
|
component = new ReactRenderer(MentionList, {
|
||||||
|
@ -42,7 +42,7 @@ export const mentionSuggestion = (users: User[]): Suggestion => ({
|
||||||
}
|
}
|
||||||
|
|
||||||
popup[0].setProps({
|
popup[0].setProps({
|
||||||
getReferenceClientRect: props.clientRect,
|
getReferenceClientRect: props.clientRect as any,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onKeyDown(props) {
|
onKeyDown(props) {
|
||||||
|
@ -50,7 +50,7 @@ export const mentionSuggestion = (users: User[]): Suggestion => ({
|
||||||
popup[0].hide()
|
popup[0].hide()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return component.ref?.onKeyDown(props)
|
return (component.ref as any)?.onKeyDown(props)
|
||||||
},
|
},
|
||||||
onExit() {
|
onExit() {
|
||||||
popup[0].destroy()
|
popup[0].destroy()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user