Skip to content

Commit

Permalink
Merge pull request #5523 from jay-hodgson/SWC-7048
Browse files Browse the repository at this point in the history
SWC-7048: If the anchor target is unset or set to _self, do not attem…
  • Loading branch information
jay-hodgson authored Sep 18, 2024
2 parents 4491905 + 802c1c3 commit f724995
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 f724995

Please sign in to comment.