Skip to content

fix(ios): ignore keyboard events that don't originate from this app#1512

Open
ridafkih wants to merge 2 commits into
kirillzyusko:mainfrom
ridafkih:fix/ignore-foreign-keyboard-events
Open

fix(ios): ignore keyboard events that don't originate from this app#1512
ridafkih wants to merge 2 commits into
kirillzyusko:mainfrom
ridafkih:fix/ignore-foreign-keyboard-events

Conversation

@ridafkih

@ridafkih ridafkih commented Jun 23, 2026

Copy link
Copy Markdown

📜 Description

💡 Motivation and Context

If you open an application into a screen that uses a KeyboardAvoidingView while a keyboard is open on iOS (ie., from Spotlight Search, swiping), despite iOS dismissing the keyboard, the area will be reserved for the keyboard because it does not ignore external keyboard observations.

📢 Changelog

iOS

  • ignore external keyboard movement observations

🤔 How Has This Been Tested?

In a local version, I applied the same changes to a patched version, and tested the changes.

📸 Screenshots (if appropriate):

Before After
ScreenRecording_06-23-2026.16-27-22_1.mov
ScreenRecording_06-23-2026.16-28-32_1.mp4

📝 Checklist

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

@kirillzyusko

Copy link
Copy Markdown
Owner

Hey @ridafkih

Don't you mind attaching a video to show how it works before after? And maybe explain how to repro the bug? I. e. what exactly to do to repet the issue?

Comment thread ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift Outdated
@ridafkih

Copy link
Copy Markdown
Author

@kirillzyusko I'll get you a video, sounds good - for context the library iOS observer is reacting to all UIKeyboardWill/Did{Show,Hide}Notification without any filtering. So when the application foregrounds when there's a system keyboard from another context like iOS Spotlight (easiest way to reproduce imo) we observe the show with isLocal=false, and since there's no matching hide, it leaves the KAV stuck at a juicy keyboard-sized paddingBottom.

So to reproduce...

  1. Open a React Native application, and put it on a view with a KAV.
  2. Soft-close the application (background) on iOS
  3. Search for the application using Spotlight
  4. Click the "Return" or "Enter" key

From there, the KAV should have the padding still there.

@ridafkih

Copy link
Copy Markdown
Author

@kirillzyusko One important comment, I failed to reproduce the issue on a simulator. It requires--as far I can tell--a physical device.

@ridafkih

This comment was marked as duplicate.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
321433 bytes 321401 bytes 32 bytes 📈

@ridafkih

This comment was marked as duplicate.

@ridafkih

Copy link
Copy Markdown
Author

@kirillzyusko I've gone ahead and updated the description with videos of a reproduction and proof of patch.

@ridafkih ridafkih requested a review from kirillzyusko June 23, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants