Skip to content

fix: call syncUpLayout on iOS when keyboard changes its mode (emoji vs text)#1417

Merged
kirillzyusko merged 1 commit intomainfrom
fix/update-absoluteY-when-emoji-keyboard
Mar 31, 2026
Merged

fix: call syncUpLayout on iOS when keyboard changes its mode (emoji vs text)#1417
kirillzyusko merged 1 commit intomainfrom
fix/update-absoluteY-when-emoji-keyboard

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Mar 31, 2026

📜 Description

Fixed a problem when switch text -> emoji -> text keeps pushing the content inside KeyboardAwareScrollView further and further.

💡 Motivation and Context

The issue has been introduced in this PR: #760

The problem with:

if UIResponder.current == currentResponder {
  return
}

Is that when keyboard resizes we never emit syncUpLayout event. The fix proposed in this PR is safe, because:

  • we don't run full input listeners mount cycle;
  • we only emit additional event;
  • it's safe to emit this event multiple times (i. e. two times on focus) because we have this guard:
    if NSDictionary(dictionary: data).isEqual(to: lastEventDispatched) {
      return
    }

Another attempt to fix it has been added here #1407 But in #1407 we are trying to make JS code even more complex and the main problem is that with this fix documentation stays incorrect:

when keyboard changes its size (appears, disappears, changes size because of different input mode);

So this is a better fix that fixes a native side of the platform.

Closes #1318 #1407

📢 Changelog

iOS

  • dispatch syncUpLayout if this event comes from keyboard notification;

🤔 How Has This Been Tested?

Tested manually on iPhone 17 Pro (iOS 26.2) paper arch.

📸 Screenshots (if appropriate):

Before After
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-31.at.18.13.00.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-31.at.17.26.31.mov

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Mar 31, 2026
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🍎 iOS iOS specific focused input 📝 Anything about focused input functionality labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
310072 bytes 309906 bytes 166 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review March 31, 2026 15:19
@kirillzyusko kirillzyusko merged commit 7b98133 into main Mar 31, 2026
22 of 23 checks passed
@kirillzyusko kirillzyusko deleted the fix/update-absoluteY-when-emoji-keyboard branch March 31, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working focused input 📝 Anything about focused input functionality 🍎 iOS iOS specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent vertically centered TextInput from jumping when keyboard resizes

1 participant