Skip to content

Commit

Permalink
Merge pull request #1391 from massenergize/fix-teams-search-field
Browse files Browse the repository at this point in the history
Fix: search functionality on the TeamsPage
  • Loading branch information
abdullai-t authored Jul 11, 2024
2 parents 0343ebe + 75d5e62 commit ae8f992
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Pages/TeamsPage/TeamsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TeamsPage extends React.Component {
createTeamModalOpen: false,
redirectID: null,
teamsData: getTeamsData(teamsStats),
searchText: "",
};
}

Expand Down Expand Up @@ -64,6 +65,7 @@ class TeamsPage extends React.Component {

handleSearch(event) {
const { teamsData } = this.state;
this.setState({ searchText: event.target.value.trim() });

const query = event.target.value.trim();
if (query === "" || teamsData.length === 0) {
Expand Down Expand Up @@ -211,6 +213,7 @@ class TeamsPage extends React.Component {
<METextField
onChange={(event) => this.handleSearch(event)}
type="text"
value={this.state.searchText}
placeholder="Search for a team..."
/>
</div>
Expand Down

0 comments on commit ae8f992

Please sign in to comment.