mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🐛 Fix hidden preview buttons in Standard Payments
Addresses an issue when toggling the “Customize per location” checkbox multiple times.
This commit is contained in:
parent
e748ef74ba
commit
c0c4d8d514
1 changed files with 12 additions and 1 deletions
|
@ -206,7 +206,18 @@ class PreviewButtonManager {
|
|||
* Apples the provided configuration to all existing preview buttons.
|
||||
*/
|
||||
_configureAllButtons(ppcpConfig) {
|
||||
Object.keys(this.buttons).forEach(id => this._configureButton(id, ppcpConfig));
|
||||
Object.entries(this.buttons).forEach(([id, button]) => {
|
||||
this._configureButton(id, {
|
||||
...ppcpConfig,
|
||||
button: {
|
||||
...ppcpConfig.button,
|
||||
|
||||
// The ppcpConfig object might refer to a different wrapper.
|
||||
// Fix the selector, to avoid unintentionally hidden preview buttons.
|
||||
wrapper: button.wrapper,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue