Change autosuggestions to include second word in web UI (#39622)

This commit is contained in:
Eugen Rochko authored and GitHub committed 2026-06-25 15:49:27 +00:00
1 parent 19db9eeb81
commit e4e19ba264
3 files changed
+32 -51

No files matched your search

@@ -12,31 +12,7 @@ import AutosuggestAccountContainer from '../features/compose/containers/autosugg
import { AutosuggestEmoji } from './autosuggest_emoji';
import { AutosuggestHashtag } from './autosuggest_hashtag';
import { LocalCustomEmojiProvider } from './emoji/context';
const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => {
let word;
let left = str.slice(0, caretPosition).search(/\S+$/);
let right = str.slice(caretPosition).search(/\s/);
if (right < 0) {
word = str.slice(left);
} else {
word = str.slice(left, right + caretPosition);
}
if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) {
return [null, null];
}
word = word.trim();
if (word.length > 0) {
return [left + 1, word];
} else {
return [null, null];
}
};
import { textAtCursorMatchesToken } from './autosuggest/utils';
export default class AutosuggestInput extends ImmutablePureComponent {