Skip to content

Commit 87eb3ce

Browse files
author
Serhii Balko
committed
Merge remote-tracking branch 'origin/MC-41611' into 2.4-develop-pr58
2 parents d6b7dc7 + 3c2a601 commit 87eb3ce

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ define([
238238

239239
// Add defaultvalue attribute to state/province select element
240240
regionList.attr('defaultvalue', this.options.defaultRegion);
241+
this.options.form.find('[type="submit"]').removeAttr('disabled').show();
241242
},
242243

243244
/**

app/code/Magento/Customer/view/frontend/templates/address/edit.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ $viewModel = $block->getViewModel();
202202
<button type="submit"
203203
class="action save primary"
204204
data-action="save-address"
205+
disabled="disabled"
205206
title="<?= $escaper->escapeHtmlAttr(__('Save Address')) ?>">
206207
<span><?= $escaper->escapeHtml(__('Save Address')) ?></span>
207208
</button>

dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,18 @@ public function testCheckPostCodeLabels(): void
204204
)
205205
);
206206
}
207+
208+
/**
209+
* Check that submit button is disabled
210+
*
211+
* @magentoDataFixture Magento/Customer/_files/customer.php
212+
* @magentoDataFixture Magento/Customer/_files/customer_address.php
213+
* @return void
214+
*/
215+
public function testSubmitButtonIsDisabled(): void
216+
{
217+
$html = $this->block->toHtml();
218+
$buttonXpath = "//form[contains(@class, 'form-address-edit')]//button[@type='submit' and @disabled='disabled']";
219+
$this->assertEquals(1, Xpath::getElementsCountForXpath($buttonXpath, $html));
220+
}
207221
}

0 commit comments

Comments
 (0)