Skip to content

Commit 723a11b

Browse files
committed
Fixed: duplicate calls to scrollRangeToVisible
1 parent af6a3c5 commit 723a11b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

GrowingTextView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

1414
# This description is used to generate tags and improve search results.

Pod/Classes/GrowingTextView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ open class GrowingTextView: UITextView {
135135
// Workaround to for incorrect scroll position on Swift4
136136
self.heightConstraint!.constant += 0.0000001
137137
self.isGrowing = false
138+
} else {
139+
self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom
138140
}
139-
self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom
140141
} else {
141142
self.scrollRangeToVisible(NSMakeRange(0, 0)) // Scroll to top
142143
}

0 commit comments

Comments
 (0)