From 6d6b1239085ab8e48e84bb8934a4f24dbfdb1d68 Mon Sep 17 00:00:00 2001 From: Alec Neevel Date: Tue, 19 Dec 2023 14:35:08 -0600 Subject: [PATCH] Send SELECT_SEARCH_RESULT event only on left-mouse clicks (#3472) * Add check for left click before sending search result event * correct event code * Revert "correct event code" This reverts commit aba8ff10a027a5771285dfdd7662e2ef0a462859. * correct event code * Lint Signed-off-by: Olga Bulat --------- Signed-off-by: Olga Bulat Co-authored-by: Olga Bulat --- frontend/src/components/VImageCell/VImageCell.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/VImageCell/VImageCell.vue b/frontend/src/components/VImageCell/VImageCell.vue index a25f3379259..90efb03110f 100644 --- a/frontend/src/components/VImageCell/VImageCell.vue +++ b/frontend/src/components/VImageCell/VImageCell.vue @@ -183,7 +183,15 @@ export default defineComponent({ }) const { sendCustomEvent } = useAnalytics() - const sendSelectSearchResultEvent = () => { + + /** + * If the user left clicks on a search result, send + * the SELECT_SEARCH_RESULT custom event + * @param event - the mouse click event + */ + const sendSelectSearchResultEvent = (event: MouseEvent) => { + if (event.button !== 0) return + sendCustomEvent("SELECT_SEARCH_RESULT", { id: props.image.id, kind: props.kind,