Skip to content

Commit

Permalink
fix: track context menu open as click (#381)
Browse files Browse the repository at this point in the history
* fix: track contextMenu opens as a click

* chore: changeset
  • Loading branch information
sampotts authored Feb 1, 2021
1 parent 0a237c4 commit fb94f36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/olive-timers-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sajari/react-components': patch
'@sajari/react-search-ui': patch
---

Track context menu open as a click
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DropdownResult = (props: DropdownResultProps) => {
className={classnames(resultClassName, { [selectedResultClassName]: selected })}
{...rest}
>
<Box as="a" href={value.url} onClick={value.onClick} css={styles.item}>
<Box as="a" href={value.url} onClick={value.onClick} onContextMenu={value.onClick} css={styles.item}>
<Box css={styles.imageContainer} className={resultImageContainerClassName}>
<Image src={value.image} aspectRatio={1} objectFit="contain" />
</Box>
Expand Down
8 changes: 7 additions & 1 deletion packages/search-ui/src/Results/components/Result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ const Result = React.memo(
return (
<Box as="article" {...rest} css={[styles.container, stylesProp]}>
{(isValidURL(imageSrc, true) || forceImage) && (
<Link href={href} onClick={onClick} css={styles.imageContainer} disableDefaultStyles={disableDefaultStyles}>
<Link
href={href}
onClick={onClick}
onContextMenu={onClick}
css={styles.imageContainer}
disableDefaultStyles={disableDefaultStyles}
>
<Image
src={imageSrc}
hoverSrc={imageHoverSrc}
Expand Down

0 comments on commit fb94f36

Please sign in to comment.