Skip to content

Add onEndTimeChange event (#838)#845

Open
atheck wants to merge 4 commits intonamespace-ee:mainfrom
atheck:atheck/issue838
Open

Add onEndTimeChange event (#838)#845
atheck wants to merge 4 commits intonamespace-ee:mainfrom
atheck:atheck/issue838

Conversation

@atheck
Copy link

@atheck atheck commented Dec 18, 2021

Issue Number

#838

Overview of PR

I indeed didn't found a good solution to this. So I decided to add an event which is called when scrolling ends. This way I can reload data when this new event gets fired. I think this resolves the issue for me.

@lnagel
Copy link
Member

lnagel commented Feb 5, 2026

@developer-ocansey — Flagging this for your review.

Recommendation: Worth porting to the current TypeScript codebase

What it does

Adds an onEndTimeChange callback that fires when scrolling finishes (on mouse-up or touch-end), reporting the final visibleTimeStart and visibleTimeEnd. This complements the existing onTimeChange which fires continuously during scroll — useful for loading data only when scrolling stops rather than on every tick.

Why it's valuable

This is a commonly requested feature (linked to issue #838). The current codebase has no equivalent. The implementation is clean with proper separation of concerns:

  • Adds an onEndScroll prop to ScrollElement, called on handleMouseUp and handleTouchEnd
  • Tracks a scrolled flag so the callback only fires after actual scrolling
  • Extracts a getVisibleTimeRange helper as a useful refactor
  • Tests cover both positive (scrolled → mouseUp fires callback) and negative (mouseUp without scroll doesn't fire) cases

What needs adaptation

The PR targets the old JS files and has merge conflicts. The current ScrollElement.tsx has been rewritten to use the PointerEvents API instead of separate mouse/touch handlers. To port this:

  • onEndScroll should be called from handlePointerEnd (and handleTouchEnd) in the current ScrollElement.tsx
  • The scrolled flag tracking pattern translates directly
  • Types need to be added for the new prop and callback

Effort estimate

Medium — the concept maps directly to the current architecture, just needs TS conversion and PointerEvents adaptation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants