AttributedString equality: only check tags of parentShadowView; ShadowViews are never equal otherwise

Summary:
For future diffs, we need to check AttributedStrings for equality.
It turns out that any time props or state change, two `parentShadowView`s will never be equal to each other, even if we'd consider them equal for our use-cases here for AttributedStrings. Just compare the tags instead of the whole object.

NOTE: I don't have any strong opinions about how we should be comparing them. It just isn't working currently for AndroidTextInput. Comparing tags seems convenient and reasonably correct for now.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D18786004

fbshipit-source-id: 13c0e881cd8d2c2a207e8891309b3c9b880b827f
This commit is contained in:
Joshua Gross
2019-12-05 13:20:29 -08:00
committed by Facebook Github Bot
parent 25ce622683
commit 2a46980535
@@ -26,8 +26,8 @@ bool Fragment::isAttachment() const {
}
bool Fragment::operator==(const Fragment &rhs) const {
return std::tie(string, textAttributes, parentShadowView) ==
std::tie(rhs.string, rhs.textAttributes, rhs.parentShadowView);
return std::tie(string, textAttributes, parentShadowView.tag) ==
std::tie(rhs.string, rhs.textAttributes, rhs.parentShadowView.tag);
}
bool Fragment::operator!=(const Fragment &rhs) const {