You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are looking at fixing the soft keyboard to give us better and more comprehensive control, I suggest you also consider also adding to the LifeCycle for Android:
onKeyDown, onKeyUp, dispatchKeyEvent, and/or dispatchKeyEventPreIme to capture the close command triggered by the back button on Android to close the soft keyboard in Android.
Currently these are all missing from the Lifecycle as per: #18535
This prevents us from reacting to this properly except by querying the height of the keyboard by Android methods and reacting to it manually if it goes from >0 in one frame to == 0 in the next (which is tedious).
I think any good Keyboard API should include some combination of the following:
1) Open/Close Events
keyboardOpeningStartedEvent
keyboardOpeningFinishedEvent
keyboardClosingStartedEvent
keyboardClosingFinishedEvent
Currently I track such events based on monitoring the height of the keyboard in Android frame by frame and whether it is growing/shrinking or stable frame by frame. iOS is a bit easier. Perhaps there is no better way in Android. Not sure if you'd want to implement something so hacky.
Simpler would just be:
keyboardHeightChangedEvent()
And we can infer from that what we can. Though this is less useful overall.
2) Keyboard Height
getKeyboardHeight() or getKeyboardSize()
Should be gettable at any time, and also passed through event args for open/close events if using those too.
3) Commands to Manually Open (or At Least Close) Keyboard
openSoftKeyboard()
closeSoftKeyboard()
This would prevent needing platform based code like I described to figure this stuff out for each user.
To Discuss for .NET9
AdjustPan
andAdjustResize
behavior for iOS as well as Android #11979The text was updated successfully, but these errors were encountered: