Skip to content

[ECE] Enhancement: prevent ECE settings preview from re-creating the ECE element when settings change #9091

Open

Description

Description

Based on discussion in #9028 (comment).

When ECE is enabled and the settings are changed the preview needs to re-create the iframe from Stripe, causing the buttons to disappear for ~1-2 seconds. We may want to explore trying to prevent this.

The reason we need to recreate the iframe is that some of the configurations are set on an event that fires when the button is initialized, instead of being passed as props to Stripe's ECE.

Demonstration of the issue:

Screen.Recording.2024-07-08.at.6.38.46.PM.mov

Acceptance criteria

  • Buttons react immediately to settings changes

Designs

Testing instructions

  1. Enable ECE.
  2. Go to the WooPayment settings.
  3. Click Customize next to the Apple Pay/Google Pay option.
  4. Change the call to action or theme.

Dev notes

The proposed solution is to render all possible variations of the settings and hide them all via display: none;, except the one button that matches the current configuration. This has not been tested and may not work.

Additional context

#9028 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    component: payment request buttonApple Pay, Google Pay, etcfocus: checkout paymentsimpact: highThis issue impacts a lot of users as reported by our Happiness Engineers.needs designThe issue requires design input/work from a designer.priority: lowThe issue/PR is low priority—not many people are affected or there’s a workaround, etc.type: enhancementThe issue is a request for an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions