Skip to content

Commit 0fee9a1

Browse files
author
saphaljha
committed
Fixed issue when using dynamic elements
1 parent e03e17e commit 0fee9a1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function {$listenerFunction} () {
116116
{$elementName}Array.forEach(function(element){
117117
if (element) {
118118
element.{$eventName} = function (event) {
119+
event.preventDefault();
119120
var targetElement = element;
120121
if (event && event.target) {
121122
targetElement = event.target;
@@ -124,10 +125,8 @@ function {$listenerFunction} () {
124125
}
125126
}
126127
});
127-
}
128-
129-
script;
130-
128+
}
129+
script;
131130
return $this->renderTag('script', ['type' => 'text/javascript'], $script, false);
132131
}
133132

0 commit comments

Comments
 (0)