-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape does not close the autocomplete #322
Comments
I'd be happy to contribute if you need a hand, Could you give me some context? |
Thanks for opening the issue. When a user press "escape",
|
@laurentsenta @yuku Hello guys, |
Here's how you can fix this locally: class CodeMirrorEditor2 extends CodeMirrorEditor {
constructor(cm: CodeMirror.Editor) {
super(cm);
(this as any).stopListening();
(this as any).onKeyup = (_cm: CodeMirror.Editor, e: KeyboardEvent) => {
const code = this.getCode(e);
if (code !== 'DOWN' && code !== 'UP' && code !== 'ESC') {
this.emitChangeEvent();
}
};
(this as any).startListening();
}
} FYI this issue only happens with CodeMirror editor, which assumes that all the keys, except 'DOWN' and 'UP' should trigger a change event, which in turn re-opens the dropdown. I have added a third exclusion for the 'ESC' key in the above code. |
I get this behavior in my code and on the demo page:
https://yuku.takahashi.coffee/textcomplete/
:s
or something so that the autocomplete dropdown shows up,The text was updated successfully, but these errors were encountered: