Skip to content

Commit

Permalink
Merge pull request #1894 from anyproto/ios-247-incorrect-cursor-posit…
Browse files Browse the repository at this point in the history
…ion-when-we-delete-block-after-block

IOS-247 Editor | Incorrect cursor position when we delete block after block with emoji
  • Loading branch information
mgolovko authored Aug 9, 2024
2 parents 42b434d + 4255681 commit 775117f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ final class BlockActionService: BlockActionServiceProtocol {
if let textContent = previousBlock.info.textContent {
cursorManager.focus(
at: previousBlock.blockId,
position: .at(.init(location: Int(textContent.text.count), length: 0))
position: .at(NSRange(location: Int(textContent.text.utf16.count), length: 0))
)
cursorManager.blockFocus = BlockFocus(id: previousBlock.blockId, position: .at(NSRange(location: textContent.text.count, length: 0)))
cursorManager.blockFocus = BlockFocus(id: previousBlock.blockId, position: .at(NSRange(location: textContent.text.utf16.count, length: 0)))
}
try await textServiceHandler.merge(contextId: documentId, firstBlockId: previousBlock.blockId, secondBlockId: secondBlockId)
}
Expand Down

0 comments on commit 775117f

Please sign in to comment.