Commit fea0215
committed
IOS-838: ConversationInputTextView cursor adjustments don't behave properly
At the moment, when trying to drag the input/selection cursor(s) in
the ConverationInputTextView, as soon as you reach the top or bottom
edge of a draft with >4 lines, you'll immediately scroll to the very top
or the very bottom.
This is because we're currently overriding the default implementation of
setContentOffset:animated: to always perform the adjustment without
animation. We do this because we don't want the animated content offset
adjustment to interfere with the growing the bounds of the text view.
This can cause the text to overshoot the updated bounds pre-iOS 13.
But we only grow the text view in response to the text changing. So
instead of disabling all content offset animations, we can get away with
just disabling content offset animations while the text is changing.
So this commit:
- Sets a flag between -textViewShouldChange... and -textViewDidChange:
- On iOS 13 and later, we'll always respect the animate argument of
setContentOffset:animated:
- Pre-iOS 13, we'll ignore the animate parameter if the flag is set1 parent bdf03e6 commit fea0215
File tree
2 files changed
+23
-6
lines changed- Signal/src/ViewControllers/ConversationView
2 files changed
+23
-6
lines changedLines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
121 | 134 | | |
122 | 135 | | |
123 | 136 | | |
| |||
169 | 182 | | |
170 | 183 | | |
171 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
172 | 190 | | |
173 | 191 | | |
| 192 | + | |
174 | 193 | | |
175 | 194 | | |
176 | 195 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
0 commit comments