ampproject / ampproject/amphtml

amp-ad set to sticky=top does not reappear after being auto-hidden

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

Description

### Description

For an `amp-ad`, if we set the `sticky` attribute to "top", the intended behavior is that once the user scrolls to the top of the viewport, the ad disappears. This was fixed in #36378.

However, after the user scrolls to the top, if they then begin to scrolling down again, I would expect the ad to reappear, but it does not. Is this the intended behavior? It seems that would defeat the purpose of using a sticky ad and would impact revenue if the ad stays permanently hidden.

### Reproduction Steps

1. Create an ad that sticks to the top like so:
``````

2. As you start scrolling, see that the ad appears
3. Scroll back to the top and see that the ad disappears
4. Start scrolling down again and see that the ad stays hidden

### 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

Open the contributing guide

Research direction

Start by reproducing the four scrolling steps for an amp-ad with sticky="top" using the example in the issue, then inspect the amp-ad sticky behavior. Done means the ad disappears at the top and reappears when the user starts scrolling down again.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.