mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Fix tab complete order properly
Don't return NaN from your sort functions...
This commit is contained in:
parent
46a2c74d71
commit
0b0f10ddf6
1 changed files with 6 additions and 1 deletions
|
@ -341,7 +341,12 @@ class TabComplete {
|
|||
}
|
||||
|
||||
if (a.kind == 'member') {
|
||||
return this.memberTabOrder[b.member.userId] - this.memberTabOrder[a.member.userId];
|
||||
let orderA = this.memberTabOrder[a.member.userId];
|
||||
let orderB = this.memberTabOrder[b.member.userId];
|
||||
if (orderA === undefined) orderA = -1;
|
||||
if (orderB === undefined) orderB = -1;
|
||||
|
||||
return orderB - orderA;
|
||||
}
|
||||
|
||||
// anything else we have no ordering for
|
||||
|
|
Loading…
Reference in a new issue