element-hq / element-hq/hydrogen-web

Sticky date headers in timeline

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
714
Forks
131
PR merge metrics
No merged PRs in 30d

Description

https://github.com/vector-im/hydrogen-web/blob/master/prototypes/timeline.html uses `position: sticky`, but AFAICT, would require quite a bit of work to get the correct DOM structure (a wrapper per day).

We could also consider using an `IntersectionObserver` with a (negative?) top margin passed in [`rootMargin`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin) to lower the intersection to the bottom/top of the sticky date header and maintain a "flat" DOM structure. Date headers would be added/removed as they are mounted/unmounted to the shared `IntersectionObserver` for the timeline scroll area. IE11 does not support this, but it's probably fine consider this a progressive enhancement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.