Skip to content

Commit 2527b04

Browse files
committed
Other element would receive the click issue was fixed
1 parent 96a9f3a commit 2527b04

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

app/code/Magento/Swatches/Test/Mftf/Section/AdminManageSwatchSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<element name="nthSwatchText" type="input" selector="#swatch-text-options-panel table tbody tr:nth-of-type({{var}}) td:nth-of-type(3) input" parameterized="true"/>
1818
<element name="nthIsDefault" type="input" selector="(//input[@name='defaultvisual[]'])[{{var}}]" parameterized="true"/>
1919
<element name="nthSwatchAdminDescription" type="input" selector="#swatch-text-options-panel table tbody tr:nth-of-type({{var}}) td:nth-of-type(4) input" parameterized="true"/>
20+
<element name="nthVisualSwatch" type="button" selector="#swatch-visual-options-panel table tbody tr:nth-of-type({{var}}) .swatches-visual-col" parameterized="true"/>
2021
<!-- Selector for Admin Description input where the index is zero-based -->
2122
<element name="swatchAdminDescriptionByIndex" type="input" selector="input[name='optiontext[value][option_{{index}}][0]']" parameterized="true"/>
2223
<element name="nthChooseColor" type="button" selector="#swatch-visual-options-panel table tbody tr:nth-of-type({{var}}) .swatch_row_name.colorpicker_handler" parameterized="true"/>

app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckColorUploadChooserVisualSwatchTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/>
2727
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/>
2828
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/>
29-
<click selector="{{AdminManageSwatchSection.nthSwatch('3')}}" stepKey="clickSwatch3"/>
30-
<click selector="{{AdminManageSwatchSection.nthSwatch('2')}}" stepKey="clickSwatch2"/>
31-
<click selector="{{AdminManageSwatchSection.nthSwatch('1')}}" stepKey="clickSwatch1"/>
29+
<click selector="{{AdminManageSwatchSection.nthVisualSwatch('3')}}" stepKey="clickSwatch3"/>
30+
<click selector="{{AdminManageSwatchSection.nthVisualSwatch('2')}}" stepKey="clickSwatch2"/>
31+
<click selector="{{AdminManageSwatchSection.nthVisualSwatch('1')}}" stepKey="clickSwatch1"/>
3232
</test>
3333
</tests>

app/code/Magento/Swatches/view/adminhtml/web/js/visual.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ define([
403403
/**
404404
* Toggle color upload chooser
405405
*/
406-
$(document).on('click', '.swatch_window', function () {
407-
var currentElement = $(this).next('div');
406+
$(document).on('click', '.swatches-visual-col', function () {
407+
var currentElement = $(this).find('.swatch_sub-menu_container');
408408

409409
jQuery('.swatch_sub-menu_container').not(currentElement).hide();
410410
currentElement.toggle();

0 commit comments

Comments
 (0)