有谁知道如何将“显示”、“选择”和“关闭”事件绑定到 codemirror 的显示提示插件的完成对象?我想绑定这些事件的原因是我想自动定位完成列表。不知何故,当光标真正位于页面底部时,列表不在窗口中。但是当我在 codemirror 网站上查看完成演示时。它没有这个问题,它是自动定位的。请帮忙,谢谢
这是来自 codemirror 网站的文档。目前还不清楚它是如何工作的。并且没有像 jQuery doc 这样的示例或演示。
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.