Skip to content

Commit

Permalink
feat(openalex): Search on press "Enter" key
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Dec 10, 2024
1 parent 3b58c85 commit 1dc87f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/openalex-affiliations/results/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export default function Affiliations() {
<Col>
<div className="wm-title">
<span>
<i className="ri-prohibited-line fr-mr-1w" />
<i className="ri-forbid-2-line fr-mr-1w" />
Excluded RORs
</span>
</div>
Expand Down
7 changes: 5 additions & 2 deletions client/src/pages/openalex-affiliations/results/list-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import RorName from '../components/ror-name';
import WorksList from '../components/works-list';

export default function ListView({
filteredAffiliationName,
filteredAffiliations,
removeRorFromAddList,
setFilteredAffiliationName,
Expand Down Expand Up @@ -106,6 +105,11 @@ export default function ListView({
<span className="fr-icon-search-line fr-mx-1w" />
<input
onChange={(e) => setSearch(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && search.length > 0) {
setFilteredAffiliationName(search);
}
}}
style={{
border: '1px solid #ced4da',
borderRadius: '4px',
Expand Down Expand Up @@ -326,7 +330,6 @@ export default function ListView({
}}
value={selectSortOnNumberOfRors}
>
<option value="" disabled hidden>Select an option</option>
<option value="default">Default</option>
<option value="numberASC">Ascending</option>
<option value="numberDESC">Descending</option>
Expand Down

0 comments on commit 1dc87f8

Please sign in to comment.