ampproject / ampproject/amphtml
amp-script touchstart, touchmove, touchend do not register as interaction add Feature
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
## New Feature
Existing code:
https://github.com/ampproject/amphtml/blob/d2999e1b4776c438059695d7d525f2e036154e28/extensions/amp-script/0.1/user-activation-tracker.js#L18-L28
New Code:
```javascript
const ACTIVATION_EVENTS = [
'touchstart',
'touchmove',
'touchend',
'change',
'click',
'dblclick',
'input',
'keypress',
'submit',
'keydown',
];
```
## Problem
`amp-script` will block mutation, because `touchstart`, `touchmove`, `touchend` do not count as interaction.
This makes it impossible to implement things that open/close by swipe, outside of a fixed layout.
## Additional context
Should I open a PR with the suggested changes?
Contributor guide
Research direction
Start with extensions/amp-script/0.1/user-activation-tracker.js at the linked ACTIVATION_EVENTS definition and inspect how those events are used to permit mutations. Add touchstart, touchmove, and touchend as activation events, then verify that swipe-related interactions are no longer blocked by amp-script mutation restrictions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100