mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: Autocomplete wasn't showing up for PM user selection
This commit is contained in:
@ -358,12 +358,10 @@ export default function(options) {
|
|||||||
$(this).on('keyup.autocomplete', function(e) {
|
$(this).on('keyup.autocomplete', function(e) {
|
||||||
if ([keys.esc, keys.enter].indexOf(e.which) !== -1) return true;
|
if ([keys.esc, keys.enter].indexOf(e.which) !== -1) return true;
|
||||||
|
|
||||||
var cp = caretPosition(me[0]);
|
let cp = caretPosition(me[0]);
|
||||||
|
|
||||||
if (!options.key) return;
|
|
||||||
|
|
||||||
const key = me[0].value[cp-1];
|
const key = me[0].value[cp-1];
|
||||||
|
|
||||||
|
if (options.key) {
|
||||||
if (options.onKeyUp && key !== options.key) {
|
if (options.onKeyUp && key !== options.key) {
|
||||||
var match = options.onKeyUp(me.val(), cp);
|
var match = options.onKeyUp(me.val(), cp);
|
||||||
if (match) {
|
if (match) {
|
||||||
@ -373,6 +371,7 @@ export default function(options) {
|
|||||||
updateAutoComplete(dataSource(term, options));
|
updateAutoComplete(dataSource(term, options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (completeStart === null && cp > 0) {
|
if (completeStart === null && cp > 0) {
|
||||||
if (key === options.key) {
|
if (key === options.key) {
|
||||||
|
Reference in New Issue
Block a user