mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
make consecutive :/@/# separate pill candidates
e.g. accept the first character always to start the autocompletion but after that refer to the plainpart logic to split up in new pill candidates. Also, don't allow merging adjacent parts. This makes sure that "@nonmatchingfoo @someuser" only matches "someuser" in the autocomplete.
This commit is contained in:
parent
a024fd8991
commit
cf5e4d3d94
1 changed files with 10 additions and 2 deletions
|
@ -313,8 +313,16 @@ export class PillCandidatePart extends PlainPart {
|
|||
return this._autoCompleteCreator(updateCallback);
|
||||
}
|
||||
|
||||
acceptsInsertion(chr) {
|
||||
return true;
|
||||
acceptsInsertion(chr, i) {
|
||||
if (i === 0) {
|
||||
return true;
|
||||
} else {
|
||||
return super.acceptsInsertion(chr, i);
|
||||
}
|
||||
}
|
||||
|
||||
merge() {
|
||||
return false;
|
||||
}
|
||||
|
||||
acceptsRemoval(position, chr) {
|
||||
|
|
Loading…
Reference in a new issue