Skip to content

Commit

Permalink
Merge pull request #53 from GeekTree0101/bug/VEditorKit-Reset-selecti…
Browse files Browse the repository at this point in the history
…onRange-lenght-resign-first-respond-about-target-text-area

[Bug] Reset selectedRange length before resign first responder
  • Loading branch information
OhKanghoon authored Feb 11, 2019
2 parents ccb7139 + 77f23f7 commit 9b8381a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions VEditorKit/Classes/VEditorTextNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ open class VEditorTextNode: ASEditableTextNode, ASEditableTextNodeDelegate {
self.becomeActiveRelay.accept(())
}

open func editableTextNodeDidFinishEditing(_ editableTextNode: ASEditableTextNode) {
self.selectedRange = NSRange(location: self.selectedRange.location, length: 0)
}

open func editableTextNode(_ editableTextNode: ASEditableTextNode,
shouldChangeTextIn range: NSRange,
replacementText text: String) -> Bool {
Expand Down

0 comments on commit 9b8381a

Please sign in to comment.