File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
android/src/main/new_arch Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,15 @@ RootShadowNode::Unshared MarkdownCommitHook::shadowTreeWillCommit(
112112 // force measurement of a map buffer
113113 newStateData->cachedAttributedStringId = 0 ;
114114
115+ // setting -1 as the event counter makes sure that the update will be ignored by the java
116+ // part of the code, which is what we want as we don't change the attributed string here
117+ if (previousEventCount_.contains (nodes.textInput ->getTag ()) &&
118+ previousEventCount_[nodes.textInput ->getTag ()] == stateData.mostRecentEventCount ) {
119+ newStateData->mostRecentEventCount = -1 ;
120+ } else {
121+ previousEventCount_[nodes.textInput ->getTag ()] = stateData.mostRecentEventCount ;
122+ }
123+
115124 // clone the text input with the new state
116125 auto newNode = node.clone ({
117126 .state =
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ class MarkdownCommitHook : public UIManagerCommitHook {
4747 textLayoutManagers_;
4848 std::unordered_map<facebook::react::Tag, folly::dynamic>
4949 previousDecoratorProps_;
50+ std::unordered_map<facebook::react::Tag, int64_t >
51+ previousEventCount_;
5052};
5153
5254} // namespace livemarkdown
You can’t perform that action at this time.
0 commit comments