mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-23 23:29:12 -04:00
Prevent modal from closing after escaping autocomplete
This commit is contained in:
1 parent
2867cd2527
commit
012b1f757b
1 file changed
+8
@@ -129,6 +129,14 @@ CodeMirror.defineOption('environmentAutocomplete', null, (cm, options) => {
|
||||
let keydownDebounce = null;
|
||||
|
||||
cm.on('keydown', (cm, e) => {
|
||||
// Close dropdown on Escape if it's open
|
||||
if (cm.isHintDropdownActive() && e.key === 'Escape') {
|
||||
cm.closeHint();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
// Only operate on one-letter keys. This will filter out
|
||||
// any special keys (Backspace, Enter, etc)
|
||||
if (e.metaKey || e.ctrlKey || e.altKey || e.key.length > 1) {
|
||||
|
||||
Reference in new issue
Block a user