fix(ios): don't clear typing attributes on empty editor focus - #791
Merged
hejsztynx merged 1 commit intoSep 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, localized, and directly addresses the described iOS behavior without altering the broader typing-attributes flow for non-empty content.
Pull request overview
This PR adjusts iOS typing-attributes management so that focusing an empty editor (where only the selection changed) no longer clears/reset typing attributes, preserving styles set programmatically (e.g., via a toolbar) and aligning behavior with Android/Web.
Changes:
- Add an early return in
manageTypingAttributesWithOnlySelection:YESwhen the editor content length is0, avoiding unnecessary typing-attribute clearing/reapplication on an empty document.
File summaries
| File | Description |
|---|---|
| ios/inputAttributesManager/InputAttributesManager.mm | Skips typing-attribute clearing when only the selection changes and the editor is empty, preventing unintended style resets on focus. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hejsztynx
marked this pull request as ready for review
September 8, 2026 14:20
szydlovsky
approved these changes
Sep 8, 2026
hejsztynx
deleted the
@ksienkiewicz/fix-ios-typing-attributes-on-empty-editor-focus
branch
September 8, 2026 21:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fixes #322
Currently, in
manageTypingAttributesWithOnlySelection:YES, we clear typing attributes and then apply the ones applicable to the content. We also do that when editor's content itself is empty, but when there is no content, there is no need to reapply the typing attributes, as there is nothing to reapply on. That also introduced a case where a user would first set the active styles (typing attributes) programmatically, e.g. via a toolbar, and then focus it. This would result in priorly chosen styles to be reset, which is unintuitive and inconsistent to how it works on both Android and Web.Test Plan
Follow the steps in the attached video
Screenshots / Videos
Before:
Screen.Recording.2026-09-08.at.15.51.41.mov
After:
Screen.Recording.2026-09-08.at.15.43.45.mov
Compatibility
Checklist