fix: update suggestion renderer only when the editor is focused (#1115)
Closes https://github.com/elk-zone/elk/issues/898zio/stable
parent
b0164deb27
commit
7e321e906a
|
@ -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 New Issue