[Fix] context problem with device changes #1906
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.
The root cause of the issue is that device changes (like screen dimensions) are being detected correctly and the events are being dispatched and reflected in the UI. This happens because the UI is being re-rendered, and when the UI gets re-rendered, the TextField loses focus and the keyboard gets dismissed.
I tried to get the context from
Utils.globalAppKey.currentContext
but that is not working with ScopeManager, so we might need to figure out a proper solution, which will be time-consuming. I'll create a ticket for it and dedicate time to solving it because it's a separate issue that isn't currently affecting any customers or being used by them.