Fix key mismatch in text layout
Summary: Changelog: [Internal] There was a key mismatch between what Java and C++. cacheIdMap was incorrectly initialised. Differential Revision: D23652342 fbshipit-source-id: 66f54dc887a011afeead9420bda093e9a0c9a8ca
This commit is contained in:
Родитель
250485a94c
Коммит
44229d9149
|
@ -45,8 +45,9 @@ AndroidTextInputState::AndroidTextInputState(
|
||||||
"mostRecentEventCount",
|
"mostRecentEventCount",
|
||||||
previousState.mostRecentEventCount)
|
previousState.mostRecentEventCount)
|
||||||
.getInt()),
|
.getInt()),
|
||||||
cachedAttributedStringId(
|
cachedAttributedStringId(data.getDefault(
|
||||||
data.getDefault("cacheId", previousState.cachedAttributedStringId)
|
"opaqueCacheId",
|
||||||
|
previousState.cachedAttributedStringId)
|
||||||
.getInt()),
|
.getInt()),
|
||||||
attributedString(previousState.attributedString),
|
attributedString(previousState.attributedString),
|
||||||
reactTreeAttributedString(previousState.reactTreeAttributedString),
|
reactTreeAttributedString(previousState.reactTreeAttributedString),
|
||||||
|
|
|
@ -29,7 +29,7 @@ class AndroidTextInputState final {
|
||||||
* Stores an opaque cache ID used on the Java side to refer to a specific
|
* Stores an opaque cache ID used on the Java side to refer to a specific
|
||||||
* AttributedString for measurement purposes only.
|
* AttributedString for measurement purposes only.
|
||||||
*/
|
*/
|
||||||
int cachedAttributedStringId{0};
|
int64_t cachedAttributedStringId{0};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All content of <TextInput> component represented as an `AttributedString`.
|
* All content of <TextInput> component represented as an `AttributedString`.
|
||||||
|
|
|
@ -37,7 +37,7 @@ TextMeasurement TextLayoutManager::measure(
|
||||||
}
|
}
|
||||||
|
|
||||||
TextMeasurement TextLayoutManager::measureCachedSpannableById(
|
TextMeasurement TextLayoutManager::measureCachedSpannableById(
|
||||||
int cacheId,
|
int64_t cacheId,
|
||||||
ParagraphAttributes paragraphAttributes,
|
ParagraphAttributes paragraphAttributes,
|
||||||
LayoutConstraints layoutConstraints) const {
|
LayoutConstraints layoutConstraints) const {
|
||||||
const jni::global_ref<jobject> &fabricUIManager =
|
const jni::global_ref<jobject> &fabricUIManager =
|
||||||
|
@ -64,7 +64,7 @@ TextMeasurement TextLayoutManager::measureCachedSpannableById(
|
||||||
auto maximumSize = layoutConstraints.maximumSize;
|
auto maximumSize = layoutConstraints.maximumSize;
|
||||||
|
|
||||||
local_ref<JString> componentName = make_jstring("RCTText");
|
local_ref<JString> componentName = make_jstring("RCTText");
|
||||||
folly::dynamic cacheIdMap;
|
folly::dynamic cacheIdMap = folly::dynamic::object;
|
||||||
cacheIdMap["cacheId"] = cacheId;
|
cacheIdMap["cacheId"] = cacheId;
|
||||||
local_ref<ReadableNativeMap::javaobject> attributedStringRNM =
|
local_ref<ReadableNativeMap::javaobject> attributedStringRNM =
|
||||||
ReadableNativeMap::newObjectCxxArgs(cacheIdMap);
|
ReadableNativeMap::newObjectCxxArgs(cacheIdMap);
|
||||||
|
|
|
@ -42,7 +42,7 @@ class TextLayoutManager {
|
||||||
* opaque cache ID.
|
* opaque cache ID.
|
||||||
*/
|
*/
|
||||||
TextMeasurement measureCachedSpannableById(
|
TextMeasurement measureCachedSpannableById(
|
||||||
int cacheId,
|
int64_t cacheId,
|
||||||
ParagraphAttributes paragraphAttributes,
|
ParagraphAttributes paragraphAttributes,
|
||||||
LayoutConstraints layoutConstraints) const;
|
LayoutConstraints layoutConstraints) const;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче