Skip to content

Commit 60c0a60

Browse files
jainkuniyafacebook-github-bot
authored andcommitted
Fix: mostRecentEventCount is not updated. (#17990)
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
1 parent 5b98adf commit 60c0a60

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java

+4
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ public void setContentSizeWatcher(ContentSizeWatcher contentSizeWatcher) {
236236
mContentSizeWatcher = contentSizeWatcher;
237237
}
238238

239+
public void setMostRecentEventCount(int mostRecentEventCount) {
240+
mMostRecentEventCount = mostRecentEventCount;
241+
}
242+
239243
public void setScrollWatcher(ScrollWatcher scrollWatcher) {
240244
mScrollWatcher = scrollWatcher;
241245
}

ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ public void setCursorColor(ReactEditText view, @Nullable Integer color) {
408408
} catch (IllegalAccessException ex) {}
409409
}
410410

411+
@ReactProp(name= "mostRecentEventCount", defaultInt = 0)
412+
public void setMostRecentEventCount(ReactEditText view, int mostRecentEventCount) {
413+
view.setMostRecentEventCount(mostRecentEventCount);
414+
}
415+
411416
@ReactProp(name = "caretHidden", defaultBoolean = false)
412417
public void setCaretHidden(ReactEditText view, boolean caretHidden) {
413418
view.setCursorVisible(!caretHidden);

0 commit comments

Comments
 (0)