ampproject / ampproject/amphtml

amp-form: [submit-success] doesn't render when nested inside amp-list

Open
#22,924 1 comment 0 reactions 0 assignees View on GitHub
P2: Soon Stale Type: Bug WG: runtime
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?

The template for `

` doesn't render if the form is nested inside the template of an `amp-list`.

## How do we reproduce the issue?

1. Use the following AMP HTML

```html






body{visibility:hidden}


Success! Thanks {{name}} for trying the
amp-form demo! Try to insert the word "error" as a name input in the form to see how
amp-form handles errors.


Form Submission with Page Update









Check out these latest deals from our store!



{{#cart_items}}

{{name}}
{{price}}

{{/cart_items}}
{{^cart_items}}
There are no featured products available. Please check back again later.
{{/cart_items}}


Form Submission with Page Update











```

2. Try submitting the first form outside of `amp-list`. Observe that the `submit-success` template is rendered

3. Try submitting the second form inside `amp-list` template. Observe that XHR is fired and 200 is returned, but the `submit-success` template is not rendered.

## What browsers are affected?

All browsers

## Which AMP version is affected?

Tested with 1906141418310

/to @choumx

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the AMP HTML in the report, comparing the standalone form with the form nested in the amp-list template. Start by tracing the amp-form and amp-list interaction around submit-success rendering. Done means the nested form renders its success template after a successful XHR, matching the standalone form.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.