Skip to content

Commit

Permalink
SWC-7048: If the anchor target is unset or set to _self, do not attem…
Browse files Browse the repository at this point in the history
…pt to handle the link
  • Loading branch information
jay-hodgson committed Sep 17, 2024
1 parent 4491905 commit 802c1c3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,12 @@ public void onPreviewNativeEvent(NativePreviewEvent event) {
} else {
if (targetElement.hasAttribute("href")) {
String href = targetElement.getAttribute("href");
boolean handled = handleRelativePathClick(href);
if (handled) {
event.cancel();
String target = targetElement.getAttribute("target");
if (target == null || target.equals("_self")) {
boolean handled = handleRelativePathClick(href);
if (handled) {
event.cancel();
}
}
}
}
Expand Down

0 comments on commit 802c1c3

Please sign in to comment.