Skip to content

Commit a757033

Browse files
committed
MC-3939: Can't select or edit text ranges inside of a live edit block
- Fix issue when trying to focus a button from a focused tab
1 parent 535f955 commit a757033

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/button-item/preview.js

Lines changed: 3 additions & 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/js/content-type/tab-item/preview.js

Lines changed: 3 additions & 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/content-type/button-item/preview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ export default class Preview extends BasePreview {
6767
} else {
6868
// Have we moved the focus onto another button in the current group?
6969
const buttonItem = ko.dataFor(event.relatedTarget) as Preview;
70-
if (buttonItem && buttonItem.parent && buttonItem.parent.parent) {
70+
if (buttonItem && buttonItem.parent && buttonItem.parent.parent
71+
&& buttonItem.parent.parent.id === this.parent.parent.id
72+
) {
7173
const newIndex = buttonItem.parent.parent.children().indexOf(buttonItem.parent);
7274
parentPreview.focusedButton(newIndex);
75+
} else {
76+
unfocus();
7377
}
7478
}
7579
} else if (parentPreview.focusedButton() === index) {

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/tab-item/preview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ export default class Preview extends PreviewCollection {
6666
} else {
6767
// Have we moved the focus onto another button in the current group?
6868
const tabItem = ko.dataFor(event.relatedTarget) as Preview;
69-
if (tabItem && tabItem.parent && tabItem.parent.parent) {
69+
if (tabItem && tabItem.parent && tabItem.parent.parent
70+
&& tabItem.parent.parent.id === this.parent.parent.id
71+
) {
7072
const newIndex = tabItem.parent.parent.children().indexOf(tabItem.parent);
7173
parentPreview.setFocusedTab(newIndex, true);
74+
} else {
75+
unfocus();
7276
}
7377
}
7478
} else if (parentPreview.focusedTab() === index) {

0 commit comments

Comments
 (0)