From 6b03f72474be475ff524531a176c15857c09ecb4 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 13 Jul 2016 11:56:01 +0100 Subject: [PATCH] Fix filtering user list by ID Fixes https://github.com/vector-im/vector-web/issues/1739 --- src/components/views/rooms/MemberList.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 20f60c80a8..e87d31cdb3 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -442,9 +442,16 @@ module.exports = React.createClass({ var memberList = self.state.members.filter(function(userId) { var m = self.memberDict[userId]; - if (query && m.name.toLowerCase().indexOf(query) === -1) { - return false; + + if (query) { + const matchesName = m.name.toLowerCase().indexOf(query) !== -1; + const matchesId = m.userId.toLowerCase().indexOf(query) !== -1; + + if (!matchesName && !matchesId) { + return false; + } } + return m.membership == membership; }).map(function(userId) { var m = self.memberDict[userId];