-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard will show documentation #14350
Conversation
Clarified documentation for keyboardWillShow on Android
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -101,6 +101,10 @@ let Keyboard = { | |||
* | |||
* Note that if you set `android:windowSoftInputMode` to `adjustResize` or `adjustNothing`, | |||
* only `keyboardDidShow` and `keyboardDidHide` events will available on Android. | |||
* | |||
* Limitation for keyboardWillShow: On Android no event is fired when the keyboard is about | |||
* to be opened. Instead you can use a layout listener to check if the height of the layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can delete this new text and add clarification on to the end of the previous sentence, something like this but maybe better wording:
only
keyboardDidShow
andkeyboardDidHide
events will available on Android because it is not possible to listen forkeyboardWillShow
orkeyboardWillHide
events in the underlying Android APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we workaround it on native side (use another event)? Or it is just conceptually impossible/meaningless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This StackOverflow page and several others suggest that there is indeed no way on Android to do this.
* only `keyboardDidShow` and `keyboardDidHide` events will available on Android. | ||
* only `keyboardDidShow` and `keyboardDidHide` events will be available on Android and | ||
* `keyboardWillShow` as well as `keyboardWillHide` are generally not available on Android | ||
* since there is no corresponding event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relationship between android:windowSoftInputMode
, [keyboardDidShow
+ keyboardDidHide
], and [keyboardWillShow
+ keyboardWillHide
] is still unclear to me. Does android:windowSoftInputMode
affect [keyboardWillShow
+ keyboardWillHide
], or this pair of events generally unavailable on Android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyboardWillShow
and keyboardWillHide
are not available on Android. There is just no event for that. (As of now, might of course change in the future (hopefully)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything more you like to know?
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Clarified documentation for keyboardWillShow on Android as seen in issue #14275
Motivation (required)
Clarifies documentation of keyboardWillShow
Test Plan (required)
None as it is just a comment that changed.