I'm using the Ace Editor with autocompletion turned on. The editor appears in a modal frame on the page.
If the modal frame is closed (i.e. the editor is removed from the DOM) while an autocomplete popup is open, the popup gets stuck and can't be closed. What's the right way to destroy the popup?
The best I've found so far is
editor.completer.detach();
This seems to work, but it's undocumented and I don't know if there are any side-effects or concerns. Is there a better option?
detach is the right method, since it is what is called when pressing esc key see https://github.com/ajaxorg/ace/blob/60c639a34bc4a44ec84484f99bdd879177179b87/lib/ace/autocomplete.js#L207
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With