Skip to content

Commit f8ff23b

Browse files
authored
Merge pull request #250 from elfman/issue179
Fix issue #179: Search contest with keyword " ", no item show Fixes #179
2 parents fde71df + d9230e4 commit f8ff23b

File tree

1 file changed

+2
-2
lines changed
  • src/shared/components/challenge-listing/Filters/ChallengeSearchBar

1 file changed

+2
-2
lines changed

src/shared/components/challenge-listing/Filters/ChallengeSearchBar/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export default function ChallengeSearchBar({
2727
<div styleName="ChallengeSearchBar">
2828
<input
2929
onChange={event => setQuery(event.target.value)}
30-
onKeyPress={event => (event.key === 'Enter' ? onSearch(query) : null)}
30+
onKeyPress={event => (event.key === 'Enter' ? onSearch(query.trim()) : null)}
3131
placeholder={placeholder}
3232
type="text"
3333
value={query}
3434
/>
3535
<span
3636
styleName={`SearchButton ${query ? 'active' : ''}`}
37-
onClick={() => onSearch(query)}
37+
onClick={() => onSearch(query.trim())}
3838
>
3939
<ZoomIcon styleName="zoomIcon" />
4040
</span>

0 commit comments

Comments
 (0)