Skip to content

feat: add onContentInsetChange callback#1445

Merged
kirillzyusko merged 1 commit intomainfrom
feat/on-content-insets-changed
Apr 28, 2026
Merged

feat: add onContentInsetChange callback#1445
kirillzyusko merged 1 commit intomainfrom
feat/on-content-insets-changed

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Apr 27, 2026

📜 Description

Added onContentInsetChange callback.

💡 Motivation and Context

Modifying contentInsets changes scrollable area. In react-native this event propagates through onScroll event. In JS I can not modify it (this event) just because we have so many variation in terms of how to intercept the onScroll event (Animated, Reanimated, plain JS callback) so that for example for Animated with native driver I can not simply modify event structure, because I'll emit event from JS but this event is not possible to send to mobile.

So I decided to add separate onContentInsetChange event. At the moment this callback will be needed in LegendList to implement accurate scrollToEnd and other functions that depends on precise scroll coordinates.

📢 Changelog

JS

  • added onContentInsetChange callback;

🤔 How Has This Been Tested?

Tested manually.

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Apr 27, 2026
@kirillzyusko kirillzyusko added enhancement New feature or request KeyboardChatScrollView 💬 Anything about chat functionality documentation Improvements or additions to documentation labels Apr 27, 2026
@kirillzyusko kirillzyusko marked this pull request as draft April 27, 2026 10:51
@github-actions
Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
314639 bytes 312153 bytes 2486 bytes 📈

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-28 09:36 UTC

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed Apr 27, 2026, 10:54 AM

@kirillzyusko kirillzyusko marked this pull request as ready for review April 28, 2026 09:03
@github-actions
Copy link
Copy Markdown
Contributor

  1. Runtime Error when contentInset is undefined
    Why: Accessing contentInset?.top in ScrollViewWithBottomPadding can cause a runtime error if contentInset is undefined because .top is accessed on an undefined value.
    Fix: Ensure contentInset is properly initialized or use nullish coalescing to handle undefined cases.

  2. Missing Initialization of contentOffsetY
    Why: If contentOffsetY is not passed as a prop, it can lead to undefined behavior when accessing .value.
    Fix: Initialize contentOffsetY with a default value if it's not provided to prevent runtime errors.

@kirillzyusko kirillzyusko merged commit ce8ccaa into main Apr 28, 2026
21 of 22 checks passed
@kirillzyusko kirillzyusko deleted the feat/on-content-insets-changed branch April 28, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request KeyboardChatScrollView 💬 Anything about chat functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant