Skip to content

Commit

Permalink
Fix: Added .trim to prevent spaces preventing users from filtering list
Browse files Browse the repository at this point in the history
  • Loading branch information
joriordan332 committed Aug 30, 2024
1 parent 247926f commit 761be2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function SearchBar({ data, setDisplayData, setSearch, search }) {
setSearch(searchTerm);

const filteredUsers = data.filter((item) =>
item.name.toLowerCase().includes(searchTerm.toLowerCase()),
item.name.toLowerCase().includes(searchTerm.trim().toLowerCase()),
);
setDisplayData(filteredUsers);
};
Expand Down

0 comments on commit 761be2a

Please sign in to comment.