Skip to content

Optimize the shopping cart page by avoiding the first flash after user interaction. #40455

@pacome-akouedokpo

Description

@pacome-akouedokpo

Description

On your shopping page that you showed to the reader: https://amp.dev/documentation/examples/e-commerce/shopping_cart/ I tested it and noticed that after the first interaction(click on a specific add or subtract button) , there is a visual flash. This flash is only observed after the first interaction, but not after When the cart data needs to be updated in the cartitemlist state.

<script type="application/json">
{

}
</script>
But this makes the user experience unpleasant or frustrating. And I have an effective method to avoid that.

Alternatives Considered

Now, to avoid this problem, I initialized the data with AMP state via SRC from the remote source. For example...

During loading, the data will be automatically inserted into the cartitemlist state. If the user clicks any button, this updates the src file more quickly without displaying any flashing.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions