Skip to content

iOS 0 length range detection revamp - #190

Merged
szydlovsky merged 3 commits into
mainfrom
@szydlovsky/ios-detection-revamp
Oct 6, 2025
Merged

szydlovsky merged 3 commits into
mainfrom
@szydlovsky/ios-detection-revamp

Conversation

@szydlovsky

Copy link
Copy Markdown
Collaborator

I found a few really strange issues that resulted from previous assumptions; previously I thought detecting a style at a 0 length range was equivalent to cursor being there. Later code proved me wrong (mainly zero width space logic) and I decided to revamp the way it works.
Now:

  • if cursor is at the place, just use typing attributes to retrieve needed values
  • otherwise;
    • if the place is as the very end of the input, either there's no style (inline styles) or check the first character of the paragraph if it exists (paragraph styles)
    • otherwise check attributes at the given index using apple's API for this

Apart from that, this PR also fixes a situation where backspacing a list or blockquote wouldn't remove the style.

@szydlovsky
szydlovsky requested a review from exploIF October 6, 2025 14:23
@szydlovsky
szydlovsky merged commit ee9cc11 into main Oct 6, 2025
5 checks passed
@szydlovsky
szydlovsky deleted the @szydlovsky/ios-detection-revamp branch October 6, 2025 14:55
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.

2 participants