mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:11:18 +08:00
FIX: Autocomplete wasn't showing up for PM user selection
This commit is contained in:
@ -358,19 +358,18 @@ 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.onKeyUp && key !== options.key) {
|
if (options.key) {
|
||||||
var match = options.onKeyUp(me.val(), cp);
|
if (options.onKeyUp && key !== options.key) {
|
||||||
if (match) {
|
var match = options.onKeyUp(me.val(), cp);
|
||||||
completeStart = cp - match[0].length;
|
if (match) {
|
||||||
completeEnd = completeStart + match[0].length - 1;
|
completeStart = cp - match[0].length;
|
||||||
let term = match[0].substring(1, match[0].length);
|
completeEnd = completeStart + match[0].length - 1;
|
||||||
updateAutoComplete(dataSource(term, options));
|
let term = match[0].substring(1, match[0].length);
|
||||||
|
updateAutoComplete(dataSource(term, options));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user