Skip to content

Commit 9e87605

Browse files
committed
BUG#AC-1285: Buttons with duplicate labels fixed on Product landing page, add/edit product, add/edit page, add/edit block
1 parent 8cdefb0 commit 9e87605

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

app/code/Magento/Backend/Block/Widget/Button/SplitButton.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ public function getToggleAttributesHtml()
164164
if ($disabled) {
165165
$classes[] = $disabled;
166166
}
167-
168-
$attributes = ['title' => $title, 'class' => join(' ', $classes), 'disabled' => $disabled];
167+
$attributes = [
168+
'title' => $title,
169+
'class' => join(' ', $classes),
170+
'disabled' => $disabled,
171+
'aria-label' => $this->getData('dropDownAriaLabel') ?: '',
172+
];
169173
$this->_getDataAttributes(['mage-init' => '{"dropdown": {}}', 'toggle' => 'dropdown'], $attributes);
170174

171175
$html = $this->_getAttributesString($attributes);

app/code/Magento/Catalog/Block/Adminhtml/Product.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ protected function _prepareLayout()
5959
'button_class' => '',
6060
'class_name' => \Magento\Backend\Block\Widget\Button\SplitButton::class,
6161
'options' => $this->_getAddProductButtonOptions(),
62+
'dropDownAriaLabel' => 'Add product of type'
6263
];
6364
$this->buttonList->add('add_new', $addButtonProps);
6465

app/code/Magento/Cms/Block/Adminhtml/Block/Edit/SaveButton.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
99
use Magento\Ui\Component\Control\Container;
1010

11-
/**
12-
* Class SaveButton
13-
* @package Magento\Customer\Block\Adminhtml\Edit
14-
*/
1511
class SaveButton extends GenericButton implements ButtonProviderInterface
1612
{
1713
/**
14+
* Get button data
15+
*
1816
* @return array
1917
*/
2018
public function getButtonData()
@@ -42,6 +40,7 @@ public function getButtonData()
4240
],
4341
'class_name' => Container::SPLIT_BUTTON,
4442
'options' => $this->getOptions(),
43+
'dropDownAriaLabel' => 'Save options',
4544
];
4645
}
4746

app/code/Magento/Cms/Block/Adminhtml/Page/Edit/SaveButton.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
99
use Magento\Ui\Component\Control\Container;
1010

11-
/**
12-
* Class SaveButton
13-
* @package Magento\Customer\Block\Adminhtml\Edit
14-
*/
1511
class SaveButton extends GenericButton implements ButtonProviderInterface
1612
{
1713
/**
14+
* Get button data
15+
*
1816
* @return array
1917
*/
2018
public function getButtonData()
@@ -40,6 +38,7 @@ public function getButtonData()
4038
'class_name' => Container::SPLIT_BUTTON,
4139
'options' => $this->getOptions(),
4240
'sort_order' => 90,
41+
'dropDownAriaLabel' => 'Save options',
4342
];
4443
}
4544

app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Button/Save.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
use Magento\Catalog\Block\Adminhtml\Product\Edit\Button\Generic;
1010
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableType;
1111

12-
/**
13-
* Class Save
14-
*/
1512
class Save extends Generic
1613
{
1714
/**
@@ -43,6 +40,7 @@ public function getButtonData()
4340
],
4441
'class_name' => Container::SPLIT_BUTTON,
4542
'options' => $this->getOptions(),
43+
'dropDownAriaLabel' => 'Save options',
4644
];
4745
}
4846

app/code/Magento/Ui/Component/Control/SplitButton.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ public function getToggleAttributesHtml()
161161
$classes[] = $disabled;
162162
}
163163

164-
$attributes = ['title' => $title, 'class' => join(' ', $classes), 'disabled' => $disabled];
164+
$attributes = [
165+
'title' => $title,
166+
'class' => join(' ', $classes),
167+
'disabled' => $disabled,
168+
'aria-label' => $this->getData('dropDownAriaLabel') ?: '',
169+
];
165170
$this->getDataAttributes(['mage-init' => '{"dropdown": {}}', 'toggle' => 'dropdown'], $attributes);
166171

167172
$html = $this->attributesToHtml($attributes);

0 commit comments

Comments
 (0)