Skip to content

Commit

Permalink
Merge pull request #318 from visdesignlab/isu311-elementBookmark
Browse files Browse the repository at this point in the history
Fix display name for intersections in element sidebar
  • Loading branch information
NateLanza authored Mar 19, 2024
2 parents 55df9a8 + 29203ce commit 39bcd27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/upset/src/components/ElementView/ElementQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const ElementQueries = () => {
const data = useRecoilValue(dataAtom);
const rows = flattenedOnlyRows(data, provenance.getState());
const bookmarked = useRecoilValue(bookmarkedIntersectionSelector);
const currentIntersectionDisplayName = currentIntersection?.elementName.replaceAll("~&~", " & ") || "";

return (
<>
Expand Down Expand Up @@ -87,21 +88,21 @@ export const ElementQueries = () => {
backgroundColor: 'rgba(0,0,0,0.2)',
})}
icon={<SquareIcon fontSize={'1em' as any} />}
aria-label={`Selected intersection ${currentIntersection.elementName}, size ${currentIntersection.size}`}
aria-label={`Selected intersection ${currentIntersectionDisplayName}, size ${currentIntersection.size}`}
onKeyDown={(e) => {
if (e.key === 'Enter') {
actions.bookmarkIntersection(
currentIntersection.id,
currentIntersection.elementName,
currentIntersectionDisplayName,
currentIntersection.size,
);
}
}}
label={`${currentIntersection.elementName} - ${currentIntersection.size}`}
label={`${currentIntersectionDisplayName} - ${currentIntersection.size}`}
onDelete={() => {
actions.bookmarkIntersection(
currentIntersection.id,
currentIntersection.elementName,
currentIntersectionDisplayName,
currentIntersection.size,
);
}}
Expand Down

0 comments on commit 39bcd27

Please sign in to comment.