Skip to content

fix(iOS): remove images when text component is emptied - #853

Merged
szydlovsky merged 2 commits into
mainfrom
@szydlovsky/ios-text-doesnt-clear-images
Nov 5, 2026
Merged

szydlovsky merged 2 commits into
mainfrom
@szydlovsky/ios-text-doesnt-clear-images

Conversation

@szydlovsky

Copy link
Copy Markdown
Collaborator

Summary

When EnrichedText renders empty content, the images from previous content persisted, because we were not running attachments layout method.

Test Plan

  • Have EnrichedText with some image content in it
  • Change its content to empty string - observe that images don't persist.

Screenshots / Videos

Before:

before.mov

After:

after.mov

Compatibility

OS Implemented
iOS ✅
Android ❌
Web ❌

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

@szydlovsky
szydlovsky requested review from exploIF and a balanced review from Copilot November 3, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the fix that removes stale image overlays when iOS EnrichedText content becomes empty.

No open issues 🎉

What changed in this PR

Fixes stale image overlays in iOS EnrichedText when its content changes to an empty string.

Changes:

  • Calls layoutAttachments after clearing the text storage, removing images left over from previous content.
  • Adds a comment explaining the cleanup.
File Description
ios/​EnrichedTextView.mm Runs attachment layout before returning from the empty-content branch.

Review effort: Balanced

@szydlovsky
szydlovsky merged commit 74fa787 into main Nov 5, 2026
8 checks passed
@szydlovsky
szydlovsky deleted the @szydlovsky/ios-text-doesnt-clear-images branch November 5, 2026 14:46
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.

3 participants