Repository navigation
Conversation
Visual regressionNo visual differences at ios: no capture |
|
Hey @cortinico, please take a look when you have time~ |
| stripSpansOfKind(sb, Any::class.java) { span -> | ||
| span !is CharacterStyle && span !is ParagraphStyle && span !is ReactSpan |
There was a problem hiding this comment.
Could we preserve LineBreakConfigSpan here as well?
Android uses it for per-range line-breaking and hyphenation instructions.
Please also add an SDK-compatible preservation check and a regression test confirming that this layout span survives while PasswordTransformationMethod.Visible is still removed.
|
Done in 43642b2: |
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D135649529. |
There was a problem hiding this comment.
This seems like a stopgap, and solving the real issue would involve removing the view's entry from the spannable cache when the view instance is dropped. The cache is based on incrementing view IDs, so if the view manager is called with onDropViewInstance, then one can reasonably expect that to evict the cache entry
|
Done in 557462f: the cache entry is now removed in |
Summary:
Fixes #59469
On Android (Fabric), a
secureTextEntryTextInput that got input is never released after it unmounts.updateCachedSpannable()copies the text with all its spans into the static spannable cache inTextLayoutManager, and that includesPasswordTransformationMethod.Visible, which holds the view's Editable and through it the view and its Activity. The cache entry was only removed inReactEditText.finalize(), which can't run while the cache keeps the view alive.The cache is keyed by the view's tag, so
ReactTextInputManagernow removes the entry inonDropViewInstance. Once the view is dropped nothing reads that entry again, and the view can be collected.Changelog:
[ANDROID] [FIXED] - Fix
secureTextEntryTextInput staying in memory after unmountTest Plan:
Added
ReactEditTextCachedSpannableTest, which types into a TextInput, checks that the cache has an entry for its tag, callsonDropViewInstanceand checks the entry is gone. It fails onmainand passes with this change.