Skip to content

Commit c9cfe58

Browse files
author
Hwashiang Yu
committed
MC-3709: Safari and firefox button grab handles display on multiple button items
- Updated action group to unfocus button after executing js - Updated preview component logic to add active options after focus - Removed unused dependencies
1 parent 8eddb6c commit c9cfe58

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeButtonActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</arguments>
1515
<comment userInput="Adding Button" stepKey="comment"/>
1616
<executeJS function="return Math.round(document.getElementsByClassName('pagebuilder-button-item').length+1)" stepKey="initialNumberOfButtonsPlusOne"/>
17+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusButtonLiveEdit1"/>
1718
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(PageBuilderButtonsContentType.role, buttonGroupIndex)}}" stepKey="mouseOverButtonsGroup"/>
1819
<waitForPageLoad stepKey="waitForPageLoad"/>
1920
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderButtonsContentType.role)}}" stepKey="waitForOptionsMenu"/>
@@ -25,7 +26,7 @@
2526
<expectedResult type="variable">initialNumberOfButtonsPlusOne</expectedResult>
2627
<actualResult type="variable">numberOfButtonsAfterAdd</actualResult>
2728
</assertEquals>
28-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusButtonLiveEdit"/>
29+
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusButtonLiveEdit2"/>
2930
</actionGroup>
3031
<actionGroup name="validateButtonItemContent">
3132
<arguments>

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/button-item/preview.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/content-type/button-item/preview.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import $ from "jquery";
77
import $t from "mage/translate";
8-
import _ from "underscore";
98
import Option from "../../content-type-menu/option";
109
import OptionInterface from "../../content-type-menu/option.d";
1110
import BasePreview from "../preview";
@@ -61,8 +60,8 @@ export default class Preview extends BasePreview {
6160
if (!$(currentTarget).hasClass("type-nested")) {
6261
optionsMenu = optionsMenu.first();
6362
}
64-
optionsMenu.parent().addClass("pagebuilder-options-visible");
6563
$(currentTarget).find("[data-element='link_text']").focus();
64+
optionsMenu.parent().addClass("pagebuilder-options-visible");
6665
$(currentTarget).addClass("pagebuilder-content-type-active");
6766
}
6867

0 commit comments

Comments
 (0)