From 1dc87f8b633c4d4e1464fa29bd96b3d34273f14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Tue, 10 Dec 2024 10:45:51 +0100 Subject: [PATCH] feat(openalex): Search on press "Enter" key --- client/src/pages/openalex-affiliations/results/index.jsx | 2 +- .../src/pages/openalex-affiliations/results/list-view.jsx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/pages/openalex-affiliations/results/index.jsx b/client/src/pages/openalex-affiliations/results/index.jsx index 2fc61c5..d6fe02b 100644 --- a/client/src/pages/openalex-affiliations/results/index.jsx +++ b/client/src/pages/openalex-affiliations/results/index.jsx @@ -474,7 +474,7 @@ export default function Affiliations() {
- + Excluded RORs
diff --git a/client/src/pages/openalex-affiliations/results/list-view.jsx b/client/src/pages/openalex-affiliations/results/list-view.jsx index 376d8fa..5f36a4b 100644 --- a/client/src/pages/openalex-affiliations/results/list-view.jsx +++ b/client/src/pages/openalex-affiliations/results/list-view.jsx @@ -17,7 +17,6 @@ import RorName from '../components/ror-name'; import WorksList from '../components/works-list'; export default function ListView({ - filteredAffiliationName, filteredAffiliations, removeRorFromAddList, setFilteredAffiliationName, @@ -106,6 +105,11 @@ export default function ListView({ setSearch(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter' && search.length > 0) { + setFilteredAffiliationName(search); + } + }} style={{ border: '1px solid #ced4da', borderRadius: '4px', @@ -326,7 +330,6 @@ export default function ListView({ }} value={selectSortOnNumberOfRors} > -