Skip to content

Commit

Permalink
Fixed: duplicate calls to scrollRangeToVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTsang committed Oct 31, 2017
1 parent af6a3c5 commit 723a11b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GrowingTextView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "GrowingTextView"
s.version = "0.5.1"
s.version = "0.5.2"
s.summary = "UITextView on Swift 3 and Swift 4. Support auto growing, placeholder and length limit."

# This description is used to generate tags and improve search results.
Expand Down
3 changes: 2 additions & 1 deletion Pod/Classes/GrowingTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ open class GrowingTextView: UITextView {
// Workaround to for incorrect scroll position on Swift4
self.heightConstraint!.constant += 0.0000001
self.isGrowing = false
} else {
self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom
}
self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom
} else {
self.scrollRangeToVisible(NSMakeRange(0, 0)) // Scroll to top
}
Expand Down

0 comments on commit 723a11b

Please sign in to comment.