Skip to content

fix(ios): update _lastSelectedRange in importMarkdown to prevent formatting corruption on first edit#223

Merged
hryhoriiK97 merged 1 commit intomainfrom
fix/ios-stale-selection-after-import-markdown
Apr 7, 2026
Merged

fix(ios): update _lastSelectedRange in importMarkdown to prevent formatting corruption on first edit#223
hryhoriiK97 merged 1 commit intomainfrom
fix/ios-stale-selection-after-import-markdown

Conversation

@hryhoriiK97
Copy link
Copy Markdown
Collaborator

@hryhoriiK97 hryhoriiK97 commented Apr 7, 2026

What/Why?

importMarkdown: didn't update _lastSelectedRange after setting text and formatting. When called via the defaultValue prop, the selection stayed at {0, 0}, so the first keystroke used a stale range for its delta calculation — shifting or corrupting formatting positions. Fixed by syncing _lastSelectedRange inside importMarkdown: so all callers are covered.

Testing

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes

@hryhoriiK97 hryhoriiK97 merged commit 966c0ae into main Apr 7, 2026
5 checks passed
@hryhoriiK97 hryhoriiK97 deleted the fix/ios-stale-selection-after-import-markdown branch April 7, 2026 13:17
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.

1 participant