Skip to content

fix: layout for scrollable content - #127

Merged
IvanIhnatsiuk merged 3 commits into
developmentfrom
fix/layout-for-scrollable-content
Jul 20, 2026
Merged

fix: layout for scrollable content#127
IvanIhnatsiuk merged 3 commits into
developmentfrom
fix/layout-for-scrollable-content

Conversation

@IvanIhnatsiuk

Copy link
Copy Markdown
Collaborator

Summary

Explain the motivation for making this change: here are some points to help you:

This PR introduces a new prop on iOS that can disable the bouncing for the UITextView. In addition, it improves layout handling for scrollable text views.

Test Plan

Provide clear steps so another contributor can reproduce the behavior or verify the feature works.
For example:

  • Steps to reproduce the bug (if this is a bug fix)
  • Steps to verify the new feature
  • Expected vs actual results
  • Any special conditions or edge cases to test

Screenshots / Videos

Screen.Recording.2026-07-20.at.11.05.10.mov

Compatibility

OS Implemented
iOS
Android

@IvanIhnatsiuk
IvanIhnatsiuk requested a review from Copilot July 20, 2026 09:06
@IvanIhnatsiuk IvanIhnatsiuk self-assigned this Jul 20, 2026
@IvanIhnatsiuk
IvanIhnatsiuk merged commit a877b68 into development Jul 20, 2026
1 check passed
@IvanIhnatsiuk
IvanIhnatsiuk deleted the fix/layout-for-scrollable-content branch July 20, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an iOS-only bouncesVertically prop to control scroll “bounce” behavior on the underlying UITextView, and updates iOS layout/measurement logic so scrollable vs non-scrollable text views report content size more reliably.

Changes:

  • Added bouncesVertically to public TS props, native component props, and both the plain + Reanimated wrappers.
  • Implemented iOS prop handling (fallback to bounces on older iOS) and adjusted shadow-node invalidation for content-size changes.
  • Reworked InputTextView sizing to notify size changes via setContentSize + a shared size-commit path; added Android no-op setter for parity.

Reviewed changes

Copilot reviewed 9 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types.ts Adds bouncesVertically to the public prop interface.
src/EnrichedTextInputNativeComponent.ts Adds bouncesVertically to codegen/native props.
src/EnrichedTextInput.tsx Threads bouncesVertically through the JS wrapper (default true).
src/EnrichedReanimatedTextInput.tsx Threads bouncesVertically through the Reanimated wrapper (default true).
ios/EnrichedTextInputView.mm Applies bouncesVertically to the underlying UITextView / UIScrollView.
ios/internals/EnrichedTextInputViewShadowNode.mm Uses dirtyLayout()-based invalidation on content-size changes.
ios/inputTextView/InputTextView.mm Updates placeholder/layout sizing + size-change notifications.
android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewManager.kt Adds an iOS-only no-op bouncesVertically prop setter.
lib/typescript/src/types.d.ts Generated TS declarations updated for new prop.
lib/typescript/src/types.d.ts.map Generated sourcemap updated.
lib/typescript/src/EnrichedTextInputNativeComponent.d.ts Generated TS declarations updated for native props.
lib/typescript/src/EnrichedTextInputNativeComponent.d.ts.map Generated sourcemap updated.
lib/typescript/src/EnrichedTextInput.d.ts Generated TS declarations updated for wrapper signature.
lib/typescript/src/EnrichedTextInput.d.ts.map Generated sourcemap updated.
lib/typescript/src/EnrichedReanimatedTextInput.d.ts Generated TS declarations updated for Reanimated wrapper signature.
lib/typescript/src/EnrichedReanimatedTextInput.d.ts.map Generated sourcemap updated.
lib/module/EnrichedTextInputNativeComponent.ts Generated module build updated for new native prop.
lib/module/EnrichedTextInput.js Generated module build updated to pass the new prop.
lib/module/EnrichedTextInput.js.map Generated sourcemap updated.
lib/module/EnrichedReanimatedTextInput.js Generated module build updated to pass the new prop.
lib/module/EnrichedReanimatedTextInput.js.map Generated sourcemap updated.
Files not reviewed (2)
  • lib/module/EnrichedReanimatedTextInput.js: Generated file
  • lib/module/EnrichedTextInput.js: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +227 to +242
BOOL textViewBouncesVertically;

if (@available(iOS 17.4, *)) {
textViewBouncesVertically = textView.bouncesVertically;
} else {
textViewBouncesVertically = textView.bounces;
}

if (newViewProps.bouncesVertically != oldViewProps.bouncesVertically ||
textViewBouncesVertically != newViewProps.bouncesVertically) {
if (@available(iOS 17.4, *)) {
textView.bouncesVertically = newViewProps.bouncesVertically;
} else {
textView.bounces = newViewProps.bouncesVertically;
}
}
Comment on lines +202 to +208
NSInteger numberOfLines = _placeholderView.numberOfLines;
_placeholderView.numberOfLines = 1;
CGFloat height =
[_placeholderView sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)].height;
_placeholderView.numberOfLines = numberOfLines;

return height;
Comment on lines 3 to 5
#import <EnrichedTextInputView.h>
#import <React/RCTShadowView+Layout.h>
#import <react/utils/ManagedObjectWrapper.h>
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.

2 participants