@@ -933,7 +933,8 @@ - (void)slk_handlePanGestureRecognizer:(UIPanGestureRecognizer *)gesture
933
933
// Skips this if it's not the expected textView.
934
934
// Checking the keyboard height constant helps to disable the view constraints update on iPad when the keyboard is undocked.
935
935
// Checking the keyboard status allows to keep the inputAccessoryView valid when still reacing the bottom of the screen.
936
- if (![self .textView isFirstResponder ] || (self.keyboardHC .constant == 0 && self.keyboardStatus == SLKKeyboardStatusDidHide)) {
936
+ CGFloat bottomMargin = [self slk_appropriateBottomMargin ];
937
+ if (![self .textView isFirstResponder ] || (self.keyboardHC .constant == bottomMargin && self.keyboardStatus == SLKKeyboardStatusDidHide)) {
937
938
#if SLKBottomPanningEnabled
938
939
if ([gesture.view isEqual: self .scrollViewProxy]) {
939
940
if (gestureVelocity.y > 0 ) {
@@ -1169,11 +1170,12 @@ - (void)slk_enableTypingSuggestionIfNeeded
1169
1170
1170
1171
- (void )slk_dismissTextInputbarIfNeeded
1171
1172
{
1172
- if (self.keyboardHC .constant == 0 ) {
1173
+ CGFloat bottomMargin = [self slk_appropriateBottomMargin ];
1174
+ if (self.keyboardHC .constant == bottomMargin) {
1173
1175
return ;
1174
1176
}
1175
1177
1176
- self.keyboardHC .constant = 0.0 ;
1178
+ self.keyboardHC .constant = bottomMargin ;
1177
1179
self.scrollViewHC .constant = [self slk_appropriateScrollViewHeight ];
1178
1180
1179
1181
[self slk_hideAutoCompletionViewIfNeeded ];
@@ -1294,8 +1296,9 @@ - (void)didPressEscapeKey:(UIKeyCommand *)keyCommand
1294
1296
else if (_textInputbar.isEditing ) {
1295
1297
[self didCancelTextEditing: keyCommand];
1296
1298
}
1297
-
1298
- if ([self ignoreTextInputbarAdjustment ] || ([self .textView isFirstResponder ] && self.keyboardHC .constant == 0 )) {
1299
+
1300
+ CGFloat bottomMargin = [self slk_appropriateBottomMargin ];
1301
+ if ([self ignoreTextInputbarAdjustment ] || ([self .textView isFirstResponder ] && self.keyboardHC .constant == bottomMargin)) {
1299
1302
return ;
1300
1303
}
1301
1304
0 commit comments