UIFindInteraction does not clear search textfield

Originator:nikhil
Number:rdar://FB10170943 Date Originated:11/06/2022
Status:Open Resolved:No
Product:UIKit.framework Product Version:16.0
Classification: Reproducible:Yes
 
Please provide a descriptive title for your feedback:
UIFindInteraction does not clear search textfield 

Which area are you seeing an issue with?
UIKit

What type of feedback are you reporting?
Incorrect/Unexpected Behavior

Please describe the issue and what steps we can take to reproduce it:

A new `UIFindInteraction` instance does not clear the search textfield associated with it. 

Steps to reproduce:

1. In a Navigation Stack app, push a view controller that has a searchable document and UIFindInteraction implemented. 
2. Open the view controller with the associated UIFindInteraction.
3. Trigger the find interaction and search in the document. 
4. Tap on done (on the find interaction accessory toolbar presented by the UIFindInteraction)
5. Dismiss the view controller by swiping or tapping on the back button. 
6. Present the view controller again. 
7. Trigger the find interaction. The search field has the text from the previous interaction intact. 

Expected Result:

Every UIFindInteraction instance should have its own internal cache of the search field text instead of a global shared instance for the app.

Comments

Me

Please find a sample project attached to this response which reproduces the behaviour. Additional comments and exact steps to reproduce are mentioned in the README.md file.

https://github.com/dezinezync/FB10170943

Apple Feedback

Can you please provide a sample project?


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!