From 7f48a7fc9d2238134414668e0b520115706b8b2d Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 15 Dec 2016 11:40:46 -0500
Subject: PLT-4815 Refactor 'More Channels' modal into the new modal pattern
 (#4742)

* Refactor 'More Channels' modal into the new modal pattern

* Fix unit test

* Readded CSS changes
---
 webapp/components/searchable_user_list.jsx | 38 +++---------------------------
 1 file changed, 3 insertions(+), 35 deletions(-)

(limited to 'webapp/components/searchable_user_list.jsx')

diff --git a/webapp/components/searchable_user_list.jsx b/webapp/components/searchable_user_list.jsx
index 3fa912d6d..8058010ea 100644
--- a/webapp/components/searchable_user_list.jsx
+++ b/webapp/components/searchable_user_list.jsx
@@ -4,8 +4,6 @@
 import UserList from 'components/user_list.jsx';
 
 import * as Utils from 'utils/utils.jsx';
-import Constants from 'utils/constants.jsx';
-const KeyCodes = Constants.KeyCodes;
 
 import $ from 'jquery';
 import React from 'react';
@@ -21,8 +19,6 @@ export default class SearchableUserList extends React.Component {
         this.nextPage = this.nextPage.bind(this);
         this.previousPage = this.previousPage.bind(this);
         this.doSearch = this.doSearch.bind(this);
-        this.onSearchBoxKeyPress = this.onSearchBoxKeyPress.bind(this);
-        this.onSearchBoxChange = this.onSearchBoxChange.bind(this);
 
         this.nextTimeoutId = 0;
 
@@ -71,20 +67,6 @@ export default class SearchableUserList extends React.Component {
         }
     }
 
-    onSearchBoxKeyPress(e) {
-        if (e.charCode === KeyCodes.ENTER) {
-            e.preventDefault();
-            this.doSearch();
-        }
-    }
-
-    onSearchBoxChange(e) {
-        if (e.target.value === '') {
-            this.props.search(''); // clear search
-            this.setState({page: 0, search: false});
-        }
-    }
-
     render() {
         let nextButton;
         let previousButton;
@@ -158,28 +140,14 @@ export default class SearchableUserList extends React.Component {
         return (
             <div className='filtered-user-list'>
                 <div className='filter-row'>
-                    <div className='col-xs-9 col-sm-5'>
+                    <div className='col-xs-12'>
                         <input
                             ref='filter'
                             className='form-control filter-textbox'
-                            placeholder={Utils.localizeMessage('filtered_user_list.search', 'Press enter to search')}
-                            onKeyPress={this.onSearchBoxKeyPress}
-                            onChange={this.onSearchBoxChange}
+                            placeholder={Utils.localizeMessage('filtered_user_list.search', 'Search users')}
+                            onInput={this.doSearch}
                         />
                     </div>
-                    <div className='col-xs-3 col-sm-2 filter-button'>
-                        <button
-                            type='button'
-                            className='btn btn-primary'
-                            onClick={this.doSearch}
-                            disabled={this.props.users == null}
-                        >
-                            <FormattedMessage
-                                id='filtered_user_list.searchButton'
-                                defaultMessage='Search'
-                            />
-                        </button>
-                    </div>
                     <div className='col-sm-12'>
                         <span className='member-count pull-left'>{count}</span>
                     </div>
-- 
cgit v1.2.3-1-g7c22

