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(
112
112
// force measurement of a map buffer
113
113
newStateData->cachedAttributedStringId = 0 ;
114
114
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
+
115
124
// clone the text input with the new state
116
125
auto newNode = node.clone ({
117
126
.state =
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ class MarkdownCommitHook : public UIManagerCommitHook {
47
47
textLayoutManagers_;
48
48
std::unordered_map<facebook::react::Tag, folly::dynamic>
49
49
previousDecoratorProps_;
50
+ std::unordered_map<facebook::react::Tag, int64_t >
51
+ previousEventCount_;
50
52
};
51
53
52
54
} // namespace livemarkdown
You can’t perform that action at this time.
0 commit comments