Handle corner case when keyboard view is not detectable on iOS.
π‘ Motivation and Context
Sometimes app may have more than one UITextEffectsWindow and nested UIInputSetContainerView may not have a children (as on a screenshot):
In this case our previous code would return nil and full library functionality would be broken. From a screenshot above it's clear, that we should continue our search.
So to fix the problem I removed one break signal (loop over windows). Thus if we encounter empty UIInputSetContainerView we will continue search and will go to the next window (which will return a correct reference to the keyboard view).
Additionally I added return statement when we found a view (before 3 break statements served for this purpose, but since I removed one - the order is slightly broken, so to keep better backward compatibility and don't execute additional cycles if view was found - I used return statement there).
π Description
Handle corner case when keyboard view is not detectable on iOS.
π‘ Motivation and Context
Sometimes app may have more than one
UITextEffectsWindow
and nestedUIInputSetContainerView
may not have a children (as on a screenshot):In this case our previous code would return
nil
and full library functionality would be broken. From a screenshot above it's clear, that we should continue our search.So to fix the problem I removed one
break
signal (loop over windows). Thus if we encounter emptyUIInputSetContainerView
we will continue search and will go to the next window (which will return a correct reference to the keyboard view).Additionally I added
return
statement when we found a view (before 3 break statements served for this purpose, but since I removed one - the order is slightly broken, so to keep better backward compatibility and don't execute additional cycles if view was found - I usedreturn
statement there).See the context when we may have more than one
UITextEffectsWindow
in https://github.com/kirillzyusko/react-native-keyboard-controller/issues/338#issuecomment-2163904827π’ Changelog
iOS
break
inside iteration over windowsreturn
to exit fromfor
loops immediatelyπ€ How Has This Been Tested?
Tested on iPhone 15 Pro (iOS 17.5).
πΈ Screenshots (if appropriate):
π Checklist