fix: not detectable keyboard view on iOS #471
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃摐 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 #338 (comment)馃摙 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):
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-14.at.10.23.01.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-14.at.10.22.09.mp4
馃摑 Checklist