From 4d98110282c13bc2bc67de136dbe86385e7b72cb Mon Sep 17 00:00:00 2001 From: keyan Date: Thu, 26 Oct 2023 12:30:13 -0500 Subject: [PATCH] restore ctrl+click on item title clicking --- components/item.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/item.js b/components/item.js index 21245c7a..7e274c91 100644 --- a/components/item.js +++ b/components/item.js @@ -57,9 +57,17 @@ export default function Item ({ item, rank, belowTitle, right, full, children, s const viewedAt = commentsViewedAt(item) if (viewedAt) { e.preventDefault() - router.push( + if (e.ctrlKey || e.metaKey) { + window.open( + `/items/${item.id}?commentsViewedAt=${viewedAt}`, + '_blank', + 'noopener,noreferrer' + ) + } else { + router.push( `/items/${item.id}?commentsViewedAt=${viewedAt}`, `/items/${item.id}`) + } } }} ref={titleRef} className={`${styles.title} text-reset me-2`} >