mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-05 00:19:59 +00:00
fix: update suggestion renderer only when the editor is focused (#1115)
Closes https://github.com/elk-zone/elk/issues/898
This commit is contained in:
parent
b0164deb27
commit
7e321e906a
1 changed files with 4 additions and 1 deletions
|
@ -67,10 +67,13 @@ function createSuggestionRenderer(component: Component): SuggestionOptions['rend
|
|||
|
||||
// Use arrow function here because Nuxt will transform it incorrectly as Vue hook causing the build to fail
|
||||
onBeforeUpdate: (props) => {
|
||||
renderer.updateProps({ ...props, isPending: true })
|
||||
props.editor.isFocused && renderer.updateProps({ ...props, isPending: true })
|
||||
},
|
||||
|
||||
onUpdate(props) {
|
||||
if (!props.editor.isFocused)
|
||||
return
|
||||
|
||||
renderer.updateProps({ ...props, isPending: false })
|
||||
|
||||
if (!props.clientRect)
|
||||
|
|
Loading…
Reference in a new issue