forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed <TextInput>.onContentSizeChange on Android
Summary: Previously <TextInput>'s onContentSizeChange event fires very rearly, usually just once after initial layout. This diff fixed that. I also considered to a bunch of another things to get the native notification, but I found that overriding `onTextChanged` is the most reliable, easy and effitient way to implement this. I tried/considered: * onLayout (does not fire) * OnPreDrawListener (fires to often) * OnGlobalLayoutListener (does not fire) * OnLayoutChangeListener (does not fire) * isLayoutRequested (too hacky) (I also fixed the <AutoExpandingTextInput> demo to illustrate the fix.) And just heads up, we will remove `contentSize` info from `onChange` event very soon. GH issue: facebook#11692 Reviewed By: achen1 Differential Revision: D5132589 fbshipit-source-id: e7edbd8dc5ae891a6f4a87b51d9450b8c6ce4a1e
- Loading branch information
1 parent
864c9f5
commit 3539352
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters