Fix onclick listeners for non-<a> elements
parent
0fd35925b5
commit
a80fd2e5bd
|
@ -103,11 +103,9 @@ const shareon = () => {
|
|||
child.setAttribute('rel', 'noopener noreferrer');
|
||||
child.setAttribute('target', '_blank');
|
||||
} else {
|
||||
const getButtonListener = (buttonUrl) => () => {
|
||||
window.open(buttonUrl, '_blank', 'noopener,noreferrer');
|
||||
child.onclick = () => {
|
||||
window.open(url, '_blank', 'noopener,noreferrer');
|
||||
};
|
||||
|
||||
child.addEventListener('click', getButtonListener(url));
|
||||
}
|
||||
|
||||
break; // once a network is detected we don't want to check further
|
||||
|
|
Loading…
Reference in New Issue