Skip to content

Commit

Permalink
Fix: mostRecentEventCount is not updated. (#17990)
Browse files Browse the repository at this point in the history
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Update it's value as it changes on the JS thread, so that updated value is used (https://github.com/facebook/react-native/blob/f7f5dc66493ad25a85927a9503728b0491c8aab9/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java#L243) whenever setSelection(int start, int end) is called (https://github.com/facebook/react-native/blob/f7f5dc66493ad25a85927a9503728b0491c8aab9/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java#L315).
Pull Request resolved: #17990

Differential Revision: D14255969

Pulled By: mdvacca

fbshipit-source-id: 555d6752eabca5c31c1762955a56f99cc1828546
  • Loading branch information
jainkuniya authored and facebook-github-bot committed Feb 28, 2019
1 parent 5b98adf commit 60c0a60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public void setContentSizeWatcher(ContentSizeWatcher contentSizeWatcher) {
mContentSizeWatcher = contentSizeWatcher;
}

public void setMostRecentEventCount(int mostRecentEventCount) {
mMostRecentEventCount = mostRecentEventCount;
}

public void setScrollWatcher(ScrollWatcher scrollWatcher) {
mScrollWatcher = scrollWatcher;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ public void setCursorColor(ReactEditText view, @Nullable Integer color) {
} catch (IllegalAccessException ex) {}
}

@ReactProp(name= "mostRecentEventCount", defaultInt = 0)
public void setMostRecentEventCount(ReactEditText view, int mostRecentEventCount) {
view.setMostRecentEventCount(mostRecentEventCount);
}

@ReactProp(name = "caretHidden", defaultBoolean = false)
public void setCaretHidden(ReactEditText view, boolean caretHidden) {
view.setCursorVisible(!caretHidden);
Expand Down

0 comments on commit 60c0a60

Please sign in to comment.