diff --git a/src/Viewer/renderers/ref.jsx b/src/Viewer/renderers/ref.jsx
index 010d558e02..56983557c0 100644
--- a/src/Viewer/renderers/ref.jsx
+++ b/src/Viewer/renderers/ref.jsx
@@ -16,7 +16,7 @@ import styled from 'styled-components';
// }
// `;
-const RefButton = styled.button `
+const RefButton = styled.button`
position: relative;
height: 24px;
display: inline-block;
@@ -128,16 +128,16 @@ export default React.memo(function Ref(props) {
if (SVs.createButton) {
- if (externalUri) {
+ if (targetForATag === "_blank") {
return
- window.location.href = url} disabled={SVs.disabled}>{SVs.linkText}
+ window.open(url, targetForATag)} disabled={SVs.disabled}>{SVs.linkText}
;
} else {
return
navigate(url)} disabled={SVs.disabled}>{SVs.linkText}
;
}
-
+
} else {
if (haveValidTarget) {
@@ -145,8 +145,10 @@ export default React.memo(function Ref(props) {
// for some reason, if url = "#", the , below, causes a refresh
// as it removes the # from the url. So we use a directly in this case.
console.log('first case');
- return {linkContent}
+ return {linkContent}
} else {
@@ -154,10 +156,12 @@ export default React.memo(function Ref(props) {
let stateObj = { fromLink: true }
Object.defineProperty(stateObj, 'previousScrollPosition', { get: () => scrollableContainer?.[scrollAttribute], enumerable: true });
console.log('second case');
- return {linkContent}
+ return {linkContent}
}
} else {