mirror of
https://github.com/status-im/react-native.git
synced 2025-02-22 14:18:23 +00:00
Fix onPress for TextView containing just RawText
Summary: This diff enables the onPress event for TextViews that render RawText Reviewed By: shergin Differential Revision: D10222183 fbshipit-source-id: 4b6a6ad548286453f7dd3a14a5e4ee453a55b923
This commit is contained in:
parent
74a00beeb7
commit
397573ffed
@ -143,9 +143,7 @@ public class TextLayoutManager {
|
||||
new CustomTextTransformSpan(textAttributes.mTextTransform)));
|
||||
}
|
||||
|
||||
//TODO: add react tag as part of the fragments, react tag is used on Touch events
|
||||
int reactTag = 1;
|
||||
|
||||
int reactTag = fragment.getInt("reactTag");
|
||||
ops.add(new SetSpanOperation(start, end, new ReactTagSpan(reactTag)));
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fabric/attributedstring/conversions.h>
|
||||
#include <fabric/attributedstring/primitives.h>
|
||||
#include <fabric/attributedstring/AttributedString.h>
|
||||
#include <fabric/attributedstring/ParagraphAttributes.h>
|
||||
#include <fabric/attributedstring/TextAttributes.h>
|
||||
#include <fabric/attributedstring/conversions.h>
|
||||
#include <fabric/attributedstring/primitives.h>
|
||||
#include <fabric/core/conversions.h>
|
||||
#include <fabric/graphics/Geometry.h>
|
||||
#include <fabric/core/LayoutableShadowNode.h>
|
||||
#include <fabric/core/ShadowNode.h>
|
||||
#include <fabric/graphics/conversions.h>
|
||||
#include <fabric/graphics/Geometry.h>
|
||||
#include <folly/dynamic.h>
|
||||
|
||||
namespace facebook {
|
||||
@ -474,6 +476,7 @@ inline folly::dynamic toDynamic(const AttributedString &attributedString) {
|
||||
for (auto fragment : attributedString.getFragments()) {
|
||||
folly::dynamic dynamicFragment = folly::dynamic::object();
|
||||
dynamicFragment["string"] = fragment.string;
|
||||
dynamicFragment["reactTag"] = fragment.parentShadowNode->getTag();
|
||||
dynamicFragment["textAttributes"] = toDynamic(fragment.textAttributes);
|
||||
fragments.push_back(dynamicFragment);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user