Skip to content

Commit

Permalink
fix(openalex): Enable click handling for affiliation selection in lis…
Browse files Browse the repository at this point in the history
…t view
  • Loading branch information
jerem1508 committed Nov 26, 2024
1 parent 55edc66 commit 0cb7bda
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/src/pages/openalex-ror/results/list-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,17 @@ export default function ListView({
}
</div>
<div className="fr-ml-1w" style={{ display: 'inline-block', maxWidth: '95%' }}>
<Text as="span">
<Text
as="span"
onClick={() => {
if (selectedOpenAlex.some((a) => a.key === affiliation.key)) {
setSelectedOpenAlex(selectedOpenAlex.filter((a) => a.key !== affiliation.key));
} else {
setSelectedOpenAlex([...selectedOpenAlex, affiliation]);
}
}}
style={{ cursor: 'pointer' }}
>
<div dangerouslySetInnerHTML={{ __html: affiliation.nameHtml.replace(' [ source: OpenAlex ]', '') }} />
</Text>
<WorksList works={affiliation.works} />
Expand Down

0 comments on commit 0cb7bda

Please sign in to comment.