nativescript-community / nativescript-community/ui-collectionview

Strange scroll event scrollOffset

Open
#69 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
62
Forks
19
Avg merge
2d 15h
Merged PRs (30d)
2

Description

When we declare a scroll event in a CollectionView with multiple templates and without rowHeight we have a strange behavior in the scrollOffset data.

If you scroll down there are times when scrollOffset is less than the previous one, which should not happen since if it is a downward scroll it should always increase.

Reproduction repository:https://github.com/vallemar/collectionview-bug
Remove this rowHeight and you will see in the console when you scroll down: DETECTED CHANGE IN SCROLL (it shouldn't appear until you go up the list)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction repository and inspect src/components/Home.vue around line 52. Remove rowHeight, run the example, and observe the scroll event values while scrolling downward. Trace the CollectionView scroll-offset handling to identify why values decrease, then verify that downward scrolling produces monotonic scrollOffset values without the reported console warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.