Sfoglia il codice sorgente

early return on keyboardWillChangeFrameNotification if keyboard size won't change

cyberta 4 anni fa
parent
commit
321a62aa0b
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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) {
     @objc func keyboardChanged(_ notification: Notification) {
         if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
         if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
             let keyboardRectangle = keyboardFrame.cgRectValue
             let keyboardRectangle = keyboardFrame.cgRectValue
+            if (keyboardRectangle.height - intrinsicContentSize.height) == keyboardHeight {
+                return
+            }
             invalidateIntrinsicContentSize()
             invalidateIntrinsicContentSize()
             keyboardHeight = keyboardRectangle.height - intrinsicContentSize.height
             keyboardHeight = keyboardRectangle.height - intrinsicContentSize.height
             updateTextViewHeight()
             updateTextViewHeight()