I also ran into a similar issue. We found that the text field was losing the isFocused state. Redrawing the view caused this to be false.
Despite attempts to ensure that it was set to true. shouldChangeCharactersInRange does get called on autofill, but with an empty string not the OTP.
The yucky solution was to put a small delay before setting the focus state to true. This seemed to work around the bug.
No issues at all on iOS 18.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: