ampproject / ampproject/amphtml
AMP accordion data-expand snippet reports JS error when pressing buttons
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
The example in:
https://playground.amp.dev/?url=https%3A//preview.amp.dev/documentation/components/amp-accordion.example.4.html%3Fformat%3Dwebsites&_gl=1*1wv18w6*_ga*YW1wLUhqM2xfMXQ1ZG0zRWdVUm5EZXpoWlE.
which is linked from the amp-accordion documentation https://amp.dev/documentation/components/amp-accordion, shows an example, but the buttons for "Expand section 1" and "Collapse section 1" are non-functional.
I see a stack trace in the console with the following when the buttons are pressed:
```
base.js:68 Uncaught (in promise) Error: AMP-BIND is not installed.
at nt (base.js:68:17)
at i.assert (log.js:398:30)
at ti (log.js:740:31)
at standard-actions-impl.js:175:11
```
### Reproduction Steps
Open the example at:
https://playground.amp.dev/?url=https%3A%2F%2Fpreview.amp.dev%2Fdocumentation%2Fcomponents%2Famp-accordion.example.4.html%3Fformat%3Dwebsites&_gl=1*1wv18w6*_ga*YW1wLUhqM2xfMXQ1ZG0zRWdVUm5EZXpoWlE.
Click on the "Expand section 1" button. Notice the error in the JS console window, and no corresponding behavioral change on the accordion-ed section.
### Relevant Logs
_No response_
### Browser(s) Affected
_No response_
### OS(s) Affected
_No response_
### Device(s) Affected
_No response_
### AMP Version Affected
_No response_
Contributor guide
Research direction
Start with the amp-accordion documentation example linked in the issue and reproduce the failure in AMP Playground by pressing “Expand section 1” or “Collapse section 1.” Trace the AMP-BIND console error to the example configuration; done means both buttons work without the reported JavaScript error and the accordion section changes accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100