Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ios/extensions/Notification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ extension Notification {

return (duration, keyboardFrame)
}

var isLocalKeyboardEvent: Bool {
(userInfo?[UIResponder.keyboardIsLocalUserInfoKey] as? Bool) != false
}
}

extension Notification.Name {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
extension KeyboardMovementObserver {
@objc func keyboardWillAppear(_ notification: Notification) {
guard !UIResponder.isKeyboardPreloading else { return }
guard notification.isLocalKeyboardEvent else { return }
Comment thread
ridafkih marked this conversation as resolved.
Outdated

let (duration, frame) = notification.keyboardMetaData()
if let keyboardFrame = frame {
Expand Down Expand Up @@ -35,6 +36,7 @@ extension KeyboardMovementObserver {

@objc func keyboardWillDisappear(_ notification: Notification) {
guard !UIResponder.isKeyboardPreloading else { return }
guard notification.isLocalKeyboardEvent else { return }
let (duration, _) = notification.keyboardMetaData()
tag = UIResponder.current.reactViewTag
self.notification = notification
Expand All @@ -56,6 +58,7 @@ extension KeyboardMovementObserver {

@objc func keyboardDidAppear(_ notification: Notification) {
guard !UIResponder.isKeyboardPreloading else { return }
guard notification.isLocalKeyboardEvent else { return }

let (duration, frame) = notification.keyboardMetaData()
if let keyboardFrame = frame {
Expand Down Expand Up @@ -83,6 +86,7 @@ extension KeyboardMovementObserver {

@objc func keyboardDidDisappear(_ notification: Notification) {
guard !UIResponder.isKeyboardPreloading else { return }
guard notification.isLocalKeyboardEvent else { return }
let (duration, _) = notification.keyboardMetaData()
tag = UIResponder.current.reactViewTag

Expand Down
Loading