ampproject / ampproject/worker-dom

Add support for Element.scrollTop

Open
#717 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

According to https://github.com/ampproject/worker-dom/blob/master/web_compat_table.md

Element.scrollTop is not yet supported.

Would be great to add support for that, this way we could do things like:

```
window.addEventListener('scroll', e => {
const parts = document.querySelector('#globalFooter');
if (window.innerHeight < document.documentElement.scrollTop) {
parts.style.display ="block";
} else {
parts.style.display ="none";
}
});
```

Contributor guide

Open the contributing guide

Research direction

Start with web_compat_table.md and locate the Element.scrollTop entry, then search the repository for the corresponding Element or scrolling implementation. Confirm the behavior against the example in the issue and add or update coverage if the repository provides relevant tests; done means Element.scrollTop works as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
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.