UIDocumentBrowserViewController steals all input from hardware keyboard after switching apps

Originator:me
Number:rdar://FB8788193 Date Originated:2020-01-09
Status:Open Resolved:
Product:iPadOS, UIKit Product Version:
Classification: Reproducible:
 
# UIDocumentBrowserViewController steals all input from hardware keyboard after switching apps

When using UIDocumentBrowserViewController and presenting a document using a view controller with `modalPresentationStyle` set to `.overFullScreen`, the UIDocumentBrowserViewController steals whatever we type on the connected hardware keyboard (Apple Smart Keyboard Folio), effectively preventing the presented View Controller from receiving the input and key commands.

We could also use `.fullScreen` value for `modalPresentationStyle` but that result in the animated transition for opening and closing document being broken.

## Steps to reproduce

1. Run the attached project on an iPad with hardware keyboard connected
2. Create a new document using "+" button
3. Press CMD+Tab to another app
4. Press CMD+Tab back to the sample app
5. Press CMD+F

## Expected results
- Alert with title "Search" appears

## Actual results
- Keyboard accessory view appears at the bottom of the screen, a hidden textfield gets all the keyboard input. Moreover, CMD+A highlights invisible text

## Demo

https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/UIDocumentBrowserViewController-vs-HW-Keyboard

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!