Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared &
{
_textView.state = std::static_pointer_cast<const ParagraphShadowNode::ConcreteState>(state);
[_textView setNeedsDisplay];
[self setNeedsLayout];

// If the attributed string has changed, we need to notify the accessibility system that something changed,
// otherwise it may hold on to stale values (this happens most often when an element is updated async)
Expand All @@ -158,9 +157,15 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics
// re-applying individual sub-values which weren't changed.
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:_layoutMetrics];
_textView.layoutMetrics = _layoutMetrics;
_textLayoutFrame = RCTCGRectFromRect(_layoutMetrics.getContentFrame());
[_textView setNeedsDisplay];
[self setNeedsLayout];
}

- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
{
[super finalizeUpdates:updateMask];
if (updateMask & (RNComponentViewUpdateMaskState | RNComponentViewUpdateMaskLayoutMetrics)) {
[self _updateTextViewFrame];
}
}

- (void)prepareForRecycle
Expand All @@ -170,10 +175,8 @@ - (void)prepareForRecycle
_accessibilityProvider = nil;
}

- (void)layoutSubviews
- (void)_updateTextViewFrame
{
[super layoutSubviews];

CGRect textViewFrame = self.bounds;
CGRect drawingFrame = RCTCGRectFromRect(_layoutMetrics.getContentFrame());

Expand Down
Loading