Skip to content

Commit 611bdc1

Browse files
committed
fix: call syncUpLayout on iOS when keyboard changes its mode (emoji vs text)
1 parent f83e78c commit 611bdc1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

ios/observers/FocusedInputObserver.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,16 @@ public class FocusedInputObserver: NSObject {
112112
NotificationCenter.default.removeObserver(self)
113113
}
114114

115-
@objc func didReceiveFocus(_: Notification) {
115+
@objc func didReceiveFocus(_ notification: Notification) {
116116
if UIResponder.current == currentResponder {
117-
// focus was already handled by keyboard event
117+
// The same input is still focused — no need to re-run the full onFocus()
118+
// setup (observers, delegate substitution, focusDidSet event). However,
119+
// keyboardWillShowNotification also fires when the keyboard *resizes*
120+
// (e.g. switching between text and emoji keyboards). In that case we must
121+
// refresh the layout so consumers receive an up-to-date absoluteY.
122+
if notification.name == UIResponder.keyboardWillShowNotification {
123+
syncUpLayout()
124+
}
118125
return
119126
}
120127

0 commit comments

Comments
 (0)