Skip to content

Commit

Permalink
prevent listening and manipulating the anchor navigations when using …
Browse files Browse the repository at this point in the history
…a direct link (#1274)
  • Loading branch information
Galpittel authored Aug 19, 2024
1 parent 90f2d8d commit b5b5d57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b5b5d57

Please sign in to comment.