fix: removing all characters from a line logic on iOS #296
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: #287.
One of previous PRs has introduced a regression in the logic behind removing all the characters from a line.
When it happens, iOS applies attributes from the previous line.
It's especially bad when paragraph styles are in the line before and a bullet point suddenly appears.
The original fix was to manually remove the characters, remove typing attributes and for the paragraph styles reapply the style that was there in the current line.
Some PR must have removed the typing attributes/style reapplying part when working with that code so I'm returning it to the properly working state.
Test Plan
Scenario 1:
Write one line with some paragraph style.
Then another line with no styling and remove all the characters from the second line.
The paragraph style from the first line shouldn't expand to the second line.
Scenario 2:
Write one line with some paragraph style.
Then another line with a different paragraph style and remove all the characters from the second line.
The style should still be there but with an empty line and the style from first paragraph shouldn't take over the second line's styling.
Screenshots / Videos
Before
Screen.Recording.2025-11-27.at.19.17.05.mov
After
Screen.Recording.2025-11-27.at.19.58.31.mov
Compatibility