mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
- ensures arrow up/down doesn’t also apply to textarea while autocomplete is opened - ensures esc is closing autocomplete and also not closing composer while autocomplete is opened
This commit is contained in:
@@ -558,6 +558,8 @@ export default function (options) {
|
|||||||
if (e.which === keys.esc) {
|
if (e.which === keys.esc) {
|
||||||
if (div !== null) {
|
if (div !== null) {
|
||||||
closeAutocomplete();
|
closeAutocomplete();
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -605,6 +607,7 @@ export default function (options) {
|
|||||||
selectedOption = 0;
|
selectedOption = 0;
|
||||||
}
|
}
|
||||||
markSelected();
|
markSelected();
|
||||||
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
case keys.downArrow:
|
case keys.downArrow:
|
||||||
total = autocompleteOptions.length;
|
total = autocompleteOptions.length;
|
||||||
@@ -616,6 +619,7 @@ export default function (options) {
|
|||||||
selectedOption = 0;
|
selectedOption = 0;
|
||||||
}
|
}
|
||||||
markSelected();
|
markSelected();
|
||||||
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
case keys.backSpace:
|
case keys.backSpace:
|
||||||
autocompleteOptions = null;
|
autocompleteOptions = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user