@expensify/react-native-live-markdown 0.1.68 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 =
@@ -47,6 +47,8 @@ private:
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