From b5b5d57bfc99e8bd52ae537c5347c8a0d11e4cbe Mon Sep 17 00:00:00 2001 From: Galpittel <95571398+Galpittel@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:32:01 +0300 Subject: [PATCH] prevent listening and manipulating the anchor navigations when using a direct link (#1274) --- packages/gallery/src/components/item/itemView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/gallery/src/components/item/itemView.js b/packages/gallery/src/components/item/itemView.js index 695eb98de..843ffdc04 100644 --- a/packages/gallery/src/components/item/itemView.js +++ b/packages/gallery/src/components/item/itemView.js @@ -127,7 +127,12 @@ class ItemView extends React.Component { onItemInfoClick(e) { const clickTarget = 'item-info'; this.onItemClick(e, clickTarget, false); - e.stopPropagation(); + if (!this.shouldUseDirectLink()) { + // stop propagation only if we are not using direct link. + // stop propagation will prevent listening and manipulating the anchor navigations as some users do. + // we dont want to do this when we use a direct link via a tag. + e.stopPropagation(); + } } onItemClick(e, clickTarget, shouldPreventDefault = true) {