Skip to content

feat: expose onEndVisible callback from KeyboardChatScrollView#1450

Merged
kirillzyusko merged 2 commits into
mainfrom
feat/expose-onEndVisible
May 4, 2026
Merged

feat: expose onEndVisible callback from KeyboardChatScrollView#1450
kirillzyusko merged 2 commits into
mainfrom
feat/expose-onEndVisible

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented May 3, 2026

📜 Description

Added onEndVisible callback for KeyboardChatScrollView.

💡 Motivation and Context

Originally these changes were requested in #1430 for implementing functionality like "jump-to-end". I kind of agree, that we were computing the isAtEnd internally, so technically it's really not so difficult to expose it outside and it's really useful to have a logic for controlling lift behavior and end detection unified/reusable/the same.

So in this PR I'm adding this callback. It has support for both worklet and plain JS function.

Closes #1431 #1430

📢 Changelog

JS

  • added onEndVisible callback to KeyboardChatScrollView;

Docs

  • added documentation about onEndVisible callback;

🤔 How Has This Been Tested?

Tested on iPhone 17 Pro (iOS 26.2).

📸 Screenshots (if appropriate):

image

📝 Checklist

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

@kirillzyusko kirillzyusko self-assigned this May 3, 2026
@kirillzyusko kirillzyusko added enhancement New feature or request KeyboardChatScrollView 💬 Anything about chat functionality labels May 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

📊 Package size report

Current size Target Size Difference
317457 bytes 314410 bytes 3047 bytes 📈

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-04 08:02 UTC

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 3, 2026

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 changed May 4, 2026, 7:24 AM

@kirillzyusko kirillzyusko marked this pull request as ready for review May 4, 2026 07:21
@kirillzyusko kirillzyusko added the documentation Improvements or additions to documentation label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

  1. Missing null/undefined check before calling runOnJS
    Why: If onEndVisible is undefined (e.g., not provided by parent component), calling runOnJS(onEndVisible) will pass undefined to a function expecting a function reference, potentially causing runtime errors.
    Fix: Add a null/undefined check before invoking runOnJS.

  2. Potential undefined function passed to runOnJS
    Why: In useEndVisible.ts, the onEndVisible prop is not validated, leading to possible undefined being passed to runOnJS.
    Fix: Ensure onEndVisible is defined before using it in useEndVisible.

@kirillzyusko kirillzyusko merged commit 5dc5643 into main May 4, 2026
23 checks passed
@kirillzyusko kirillzyusko deleted the feat/expose-onEndVisible branch May 4, 2026 08:00
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