Skip to content

Commit e02c6b8

Browse files
authored
Product suggestions are links by default (#166)
1 parent 86ef556 commit e02c6b8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/components/Autocomplete/SectionItem/SectionItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function SectionItem(props: SectionItemProps) {
2727

2828
if (isProduct(item)) {
2929
defaultChildren = (
30-
<>
30+
<a href={item.data?.url}>
3131
<img
3232
data-testid='cio-img'
3333
src={item.data?.image_url}
@@ -41,7 +41,7 @@ export default function SectionItem(props: SectionItemProps) {
4141
highlightSearchTerm={displaySearchTermHighlights}
4242
/>
4343
</p>
44-
</>
44+
</a>
4545
);
4646
} else if (isInGroupSuggestion(item)) {
4747
defaultChildren = (

src/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@
9191
border-bottom: 3px solid transparent;
9292
}
9393

94+
.cio-autocomplete .cio-item a {
95+
color: inherit;
96+
display: inline-flex;
97+
text-decoration: inherit;
98+
flex-direction: column;
99+
}
100+
94101
.cio-autocomplete .cio-item[aria-selected='true'] {
95102
background-color: hsl(0, 0%, 90%);
96103
border-radius: 4px;
@@ -122,6 +129,7 @@
122129
width: 100%;
123130
max-width: 100px;
124131
max-height: 100px;
132+
align-self: center;
125133
}
126134

127135
.cio-autocomplete .cio-term-in-group {

0 commit comments

Comments
 (0)