Skip to content

Commit

Permalink
fix(openalex): Update checkbox handling for affiliations selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Nov 26, 2024
1 parent d68c73e commit e7ae702
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/openalex-ror/results/list-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ListView({
<div style={{ display: 'inline-flex' }}>
<div style={{ display: 'inline-block', width: '20px' }}>
<Checkbox
checked={selectedOpenAlex.includes(affiliation)}
checked={selectedOpenAlex.some((a) => a.key === affiliation.key)}
name="affiliations"
onChange={(e) => {
if (e.target.checked) {
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/openalex-ror/results/views-selector.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Badge,
Button,
Checkbox,
Col,
Modal, ModalContent, ModalFooter, ModalTitle,
Row,
Expand Down Expand Up @@ -123,7 +124,7 @@ export default function ViewsSelector({
>
<Row>
<Col xs="3">
<input
<Checkbox
checked={(selectedOpenAlex.length === filteredAffiliations.length) && (selectedOpenAlex.length > 0)}
className="fr-ml-2w"
onChange={() => {
Expand All @@ -133,9 +134,8 @@ export default function ViewsSelector({
setSelectedOpenAlex([]);
}
}}
type="checkbox"
/>
<span className="wm-text fr-mb-3w fr-ml-1w">
<span className="wm-text fr-mb-3w fr-ml-6w">
<Badge color="brown-opera">
{selectedOpenAlex.length}
</Badge>
Expand Down

0 comments on commit e7ae702

Please sign in to comment.