mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #2651 from woocommerce/PCP-3736-translations-no-longer-applied-to-card-fields-in-2-9-0
Add Custom Placeholder Handling when rendering the card fields (3736)
This commit is contained in:
commit
1325779582
1 changed files with 10 additions and 4 deletions
|
@ -8,11 +8,17 @@ function renderField( cardField, inputField ) {
|
|||
|
||||
// Insert the PayPal card field after the original input field.
|
||||
const styles = cardFieldStyles( inputField );
|
||||
cardField( { style: { input: styles } } ).render( inputField.parentNode );
|
||||
const fieldOptions = {style: { input: styles },};
|
||||
|
||||
// Hide the original input field.
|
||||
hide( inputField, true );
|
||||
inputField.hidden = true;
|
||||
if ( inputField.getAttribute( 'placeholder' ) ) {
|
||||
fieldOptions.placeholder = inputField.getAttribute( 'placeholder' );
|
||||
}
|
||||
|
||||
cardField( fieldOptions ).render( inputField.parentNode );
|
||||
|
||||
// Hide the original input field.
|
||||
hide( inputField, true );
|
||||
inputField.hidden = true;
|
||||
}
|
||||
|
||||
export function renderFields( cardFields ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue