Skip to content

fix: padding applied as margin - #358

Closed
kacperzolkiewski wants to merge 3 commits into
mainfrom
@kacperzolkiewski/fix-margin
Closed

kacperzolkiewski wants to merge 3 commits into
mainfrom
@kacperzolkiewski/fix-margin

Conversation

@kacperzolkiewski

@kacperzolkiewski kacperzolkiewski commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes: #332

  1. Implemented updateLayoutMetrics to correctly apply padding for _placeholderLabel constraints.
  2. Switched from boundingRectWithSize to [textView sizeThatFits:] to ensure measurement matches actual rendering logic exactly.
  3. Removed _performRelayout that caused scroll flickering.
  4. Added debounced ensureCursorIsVisible to fix cursor visibility when styles (like H1) change the text height dynamically.
  5. Fix position of lists markers

Test Plan

  1. Run example code from Padding seems to be applied as margin #332 and check if the padding is not applied as margin.
  2. Run example app and play with different styles - check If height of the view is correct

Screenshots / Videos

Before:

Screen.Recording.2026-01-09.at.13.22.58.mov

After:

Screen.Recording.2026-01-09.at.13.20.35.mov

Compatibility

OS Implemented
iOS
Android

@kacperzolkiewski
kacperzolkiewski marked this pull request as ready for review January 9, 2026 12:42
@kacperzolkiewski
kacperzolkiewski requested review from exploIF and szydlovsky and removed request for szydlovsky January 9, 2026 12:42
Comment thread ios/EnrichedTextInputView.mm Outdated
@IvanIhnatsiuk

IvanIhnatsiuk commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

In general, this fix is pretty much the same as what I did in #339

@kacperzolkiewski , @szydlovsky

Can we proceed with my PR instead, since this one won't react to the screen rotation and dynamic size changes + it will calculate size when width and height are not actually changed?

A small example:

" - indicates text view bounds
| - caret position

"Some text | "

If I type a text in the caret position, it won't produce a new line, it won't increase the text view width(if we set it as a static value), and there is no sense in recalculating width and height for the shadow node.

@kacperzolkiewski

Copy link
Copy Markdown
Collaborator Author

Hi @IvanIhnatsiuk,
@exploIF will look at your PR within few days.

@kacperzolkiewski
kacperzolkiewski deleted the @kacperzolkiewski/fix-margin branch May 12, 2026 12:33
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.

Padding seems to be applied as margin

2 participants