Is there an event to catch right after the autocompletion widget is inserted ?

I’m using the codemirror autocompletion in an async way, and I’ve some troubles finding out when the completion widget is attached to the dom. Is there an event to catch right after the autocompletion widget is inserted ?

Some more context of I want to achieve with this:
I want to update a documentation panel right after the completion widget is inserted in the dom. The documentation panel logic works that it analyzes the document as if the selected text of the completion popup is already inserted, but if there is no documentation popup visible, then it won’t work. So basicly the documentation resolver is not running too early. The documentation also updates when pressing down or up, but as this is not async, that works correctly, as you can see in the gif screenrecord (click on the image for it to play):

The "shown" event, fired on the completion object (not the editor) is fired exactly when the popup has been added to the DOM.

1 Like

@marijn I can’t find any “on” method on the completion object. I guess the object you are talking about is the cm.state.completionActive object, right ?

Oh I found it. I needed to do something like
CodeMirror.on(data, "shown", fn)

where data is the object with the list of hint results.