Skip to content

feat: extraContentPadding prop#1332

Merged
kirillzyusko merged 6 commits intomainfrom
feat/extra-content-padding
Mar 5, 2026
Merged

feat: extraContentPadding prop#1332
kirillzyusko merged 6 commits intomainfrom
feat/extra-content-padding

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Feb 27, 2026

📜 Description

Added extraContentPadding prop for KeyboardChatScrollView component.

💡 Motivation and Context

This prop is very useful when you want to extend scrollable range and re-arrange the content so that it takes the same position as before (relatively). Theoretically "re-arrange" functionality must be configurable, but I tested many apps and what I can tell is that it looks like almost always this "re-arrange" respects keyboardLiftBehavior prop. Later we can introduce additional prop to have a better control, but for now we keep it simple.

I was thinking on whether to make this prop a SharedValue or a plain value and I decided to make it SharedValue because:

  • theoretically we may do all work on UI thread, i. e. synchronously detect "input growth" and synchronously adjust position;
  • we may want to change position with animation (with plain number we would have to add animated prop or smth like that);
  • we may want to have a customizable animation (duration, easing, so SharedValue can be a perfect driver).

We also heavily use reanimated hooks internally, so integration with SharedValue looks very natural.

I intentionally didn't want to modify original hooks and I extended functionality using new hook: useExtraContentPadding. This new hook extends contentInsets + adjust scroll position. Maybe we'll et conflicts between hook in future, but at the moment it's extendable 😎

Closes #1324

📢 Changelog

Docs

  • added new prop description;
  • added new prop usage in guide page;

JS

  • added extraContentPadding prop for KeyboardChatScrollView component
  • cover new functionality by unit tests;

🤔 How Has This Been Tested?

Tested manually on:

  • iPhone 17 Pro (iOS 26.2);
  • Pixel 7 Pro (Android 16)

📸 Screenshots (if appropriate):

Android iOS
telegram-cloud-document-2-5280683915592373225.mp4
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-05.at.17.31.28.mov

📝 Checklist

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

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

github-actions Bot commented Feb 28, 2026

📊 Package size report

Current size Target Size Difference
286745 bytes 279973 bytes 6772 bytes 📈

@kirillzyusko kirillzyusko force-pushed the feat/extra-content-padding branch from e637a8a to 710d4c6 Compare March 4, 2026 10:21
@kirillzyusko kirillzyusko added documentation Improvements or additions to documentation tests You added or changed unit tests labels Mar 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://kirillzyusko.github.io/react-native-keyboard-controller/pr-preview/pr-1332/

Built to branch gh-pages at 2026-03-05 14:54 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Mar 5, 2026

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

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed Mar 5, 2026, 2:55 PM

@kirillzyusko kirillzyusko marked this pull request as ready for review March 5, 2026 16:20
@kirillzyusko kirillzyusko merged commit 83e34b7 into main Mar 5, 2026
18 of 23 checks passed
@kirillzyusko kirillzyusko deleted the feat/extra-content-padding branch March 5, 2026 16:37
@kirillzyusko kirillzyusko added the 🚨 requires API changes 🚨 Changes that requires changes in library API label Mar 13, 2026
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 🚨 requires API changes 🚨 Changes that requires changes in library API tests You added or changed unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyboardChatScrollView - Growing input field should push messages up

1 participant