mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Check if hosted fields instance exist before setting attribute
This commit is contained in:
parent
0781fb31d3
commit
909699886c
1 changed files with 28 additions and 24 deletions
|
@ -143,6 +143,7 @@ class CreditCardRenderer {
|
|||
}
|
||||
|
||||
disableFields() {
|
||||
if( this.currentHostedFieldsInstance) {
|
||||
this.currentHostedFieldsInstance.setAttribute({
|
||||
field: 'number',
|
||||
attribute: 'disabled'
|
||||
|
@ -156,8 +157,10 @@ class CreditCardRenderer {
|
|||
attribute: 'disabled'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
enableFields() {
|
||||
if( this.currentHostedFieldsInstance) {
|
||||
this.currentHostedFieldsInstance.removeAttribute({
|
||||
field: 'number',
|
||||
attribute: 'disabled'
|
||||
|
@ -171,6 +174,7 @@ class CreditCardRenderer {
|
|||
attribute: 'disabled'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
_submit(contextConfig) {
|
||||
this.spinner.block();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue