From 111f04ff11a2fae67644ec5d0fee0b1b3e91365c Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 7 Feb 2020 14:08:20 -0800 Subject: [PATCH] Implement setMostRecentEventCount as view command Summary: Changelog: Add view command `TextInput.setMostRecentEventCount` Reviewed By: JoshuaGross Differential Revision: D19789587 fbshipit-source-id: a52456cf5d39e25c730bbb2840009220b2242f87 --- Libraries/Text/TextInput/RCTBaseTextInputViewManager.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index beaedda782d..412e33b980f 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -117,6 +117,14 @@ RCT_EXPORT_METHOD(blur : (nonnull NSNumber *)viewTag) }]; } +RCT_EXPORT_METHOD(setMostRecentEventCount : (nonnull NSNumber *)viewTag eventCount:(NSInteger)eventCount) +{ + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { + RCTBaseTextInputView *view = (RCTBaseTextInputView *)viewRegistry[viewTag]; + view.mostRecentEventCount = eventCount; + }]; +} + #pragma mark - RCTUIManagerObserver - (void)uiManagerWillPerformMounting:(__unused RCTUIManager *)uiManager