From 34792f21c243694d73934937ab0517e6badb0708 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Wed, 6 Mar 2024 20:24:00 -0600 Subject: [PATCH] increase `ContentItem` clickable area --- .../History/Content/ContentItem.vue | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 16c5368b264c..0e5497d645cf 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -184,6 +184,7 @@ function onKeyDown(event: KeyboardEvent) { } if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); onClick(event); } else if ((event.key === "ArrowUp" || event.key === "ArrowDown") && event.shiftKey) { event.preventDefault(); @@ -206,7 +207,8 @@ function onKeyDown(event: KeyboardEvent) { } } -function onClick(event: KeyboardEvent) { +function onClick(e: Event) { + const event = e as KeyboardEvent; if (event && event.shiftKey && isSelectKey(event)) { emit("selected-to", false); } else if (event && isSelectKey(event)) { @@ -285,6 +287,12 @@ function onTagClick(tag: string) { function toggleHighlights() { emit("toggleHighlights", props.item); } + +function unexpandedClick(event: Event) { + if (!props.expandDataset) { + onClick(event); + } +}