Skip to content

Commit b067110

Browse files
committed
MC-3865: Content Types With Links Redirect On Storefront If Link Is Empty
Use "javascript:void(0)" for empty href attribute values, and style as cursor: auto
1 parent d6b3016 commit b067110

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/converter/attribute/link-href.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/converter/attribute/link-href.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default class CreateValueForHref implements ConverterInterface {
6262
public toDom(name: string, data: DataObject): string {
6363

6464
const link = data[name];
65-
let href = "";
65+
let href = "javascript:void(0)";
6666

6767
if (!link) {
6868
return href;

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/banner/_default.less

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77
// Default appearance styles
88
// _____________________________________________
99

10-
[data-role='banner'] > a {
11-
color: inherit;
12-
text-decoration: inherit;
13-
14-
&:hover {
10+
[data-role='banner'] {
11+
> a {
1512
color: inherit;
1613
text-decoration: inherit;
14+
15+
&:hover {
16+
color: inherit;
17+
text-decoration: inherit;
18+
}
19+
}
20+
21+
[data-element='link'][href='javascript:void(0)'] {
22+
cursor: auto;
1723
}
1824
}
1925

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/button-item/_default.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
[data-element='link'] {
1313
max-width: 100%;
1414
word-wrap: break-word;
15+
&[href='javascript:void(0)'] {
16+
cursor: auto;
17+
}
1518
}
1619
}
1720

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/slide/_default.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
box-sizing: border-box;
1212
overflow: hidden;
1313

14+
[data-element='link'][href='javascript:void(0)'] {
15+
cursor: auto;
16+
}
17+
1418
> a {
1519
color: inherit;
1620
text-decoration: inherit;

0 commit comments

Comments
 (0)