iOS 10.1: Removing a UITextField from its window inside a UIKeyboardWillChangeFrameNotification can leave the keyboard hanging around without firstResponder

Originator:avedesk
Number:rdar://29577461 Date Originated:08-Dec-2016 06:10 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Simulator 10.1
Classification:Performance Reproducible:Always
 
Summary:
When having a UIResponder that handles keyboard input (UITextField, UITextView and friends), sometimes the keyboard can stay on screen without the responder being on the screen/window.

Steps to Reproduce:
1. Create a UITextView and add it to a view hierarchy inside a window thats key
2. call [textView becomeFirstResponder]
3. A `UIKeyboardWillChangeFrameNotification` is posted, because the keyboard will appear
4. inside a handler for that `UIKeyboardWillChangeFrameNotification` notification, remove the UITextView from the key window (e.g. removeFromSuperview on one of its superviews)

Expected Results:
1. Keyboard disappears again
2. There is no firstResponder anymore

Actual Results:
1. Keyboard stays on screen and sends key input to the UITextView that's no longer in the key window
2. There is no firstResponder at all, yet there is a keyboard

Regression:

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!