Преглед на файлове

early return on keyboardWillChangeFrameNotification if keyboard size won't change

cyberta преди 4 години
родител
ревизия
321a62aa0b
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      deltachat-ios/Chat/Views/ChatInputBar.swift

+ 3 - 0
deltachat-ios/Chat/Views/ChatInputBar.swift

@@ -83,6 +83,9 @@ public class ChatInputBar: InputBarAccessoryView {
     @objc func keyboardChanged(_ notification: Notification) {
         if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
             let keyboardRectangle = keyboardFrame.cgRectValue
+            if (keyboardRectangle.height - intrinsicContentSize.height) == keyboardHeight {
+                return
+            }
             invalidateIntrinsicContentSize()
             keyboardHeight = keyboardRectangle.height - intrinsicContentSize.height
             updateTextViewHeight()