「表示」、「選択」、および「閉じる」イベントをコードミラーの表示ヒントアドオンの完了オブジェクトにバインドする方法を知っている人はいますか? 補完リストを自動配置したいので、これらのイベントをバインドしたい理由。どういうわけか、カーソルがページの一番下にあるときにリストがウィンドウから外れます。しかし、codemirror サイトで完了デモを見たとき。この問題はなく、自動配置されます。助けてください、ありがとう
これは codemirror サイトのドキュメントです。それがどのように機能するかは明確ではありません。jQueryドキュメントのような例やデモはありません。
The following events will be fired on the completions object during completion:
"shown" ()
Fired when the pop-up is shown.
"select" (completion, Element)
Fired when a completion is selected. Passed the completion value (string or object) and the DOM node that represents it in the menu.
"close" ()
Fired when the completion is finished.
This addon depends styles from addon/hint/show-hint.css. Check out the demo for an example.