Skip to content

Commit e427b16

Browse files
Fixes jumping focus on split UPE blocks gateway select
Fixes issue in blocks checkout where page jumps due to shifting focus by correcting caching of UPE appearance for blocks checkout.
1 parent 131c367 commit e427b16

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fixes focus change on gateway select with split UPE enabled.

client/checkout/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,11 @@ export default class WCPayAPI {
523523
* Saves the calculated UPE appearance values in a transient.
524524
*
525525
* @param {Object} appearance The UPE appearance object with style values
526-
* @param {boolean} isBlocksCheckout True if save request is for Blocks Checkout. Default false.
526+
* @param {string} isBlocksCheckout 'true' if save request is for Blocks Checkout. Default 'false'.
527527
*
528528
* @return {Promise} The final promise for the request to the server.
529529
*/
530-
saveUPEAppearance( appearance, isBlocksCheckout = false ) {
530+
saveUPEAppearance( appearance, isBlocksCheckout = 'false' ) {
531531
return this.request( getConfig( 'ajaxUrl' ), {
532532
is_blocks_checkout: isBlocksCheckout,
533533
appearance: JSON.stringify( appearance ),

client/checkout/blocks/upe-fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ const ConsumableWCPayFields = ( { api, ...props } ) => {
385385
async function generateUPEAppearance() {
386386
// Generate UPE input styles.
387387
const upeAppearance = getAppearance( true );
388-
await api.saveUPEAppearance( upeAppearance, true );
388+
await api.saveUPEAppearance( upeAppearance, 'true' );
389389

390390
// Update appearance state
391391
setAppearance( upeAppearance );

client/checkout/blocks/upe-split-fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ const ConsumableWCPayFields = ( { api, ...props } ) => {
397397
async function generateUPEAppearance() {
398398
// Generate UPE input styles.
399399
const upeAppearance = getAppearance( true );
400-
await api.saveUPEAppearance( upeAppearance, true );
400+
await api.saveUPEAppearance( upeAppearance, 'true' );
401401

402402
// Update appearance state
403403
setAppearance( upeAppearance );

0 commit comments

Comments
 (0)