VirtualView: Fix Window Focus Detection Cleanup (#52621)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52621

In D77261958, I made a typo when implementing the cleanup of window focus detection in `onDetachedFromWindow`. This fixes it.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78366506

fbshipit-source-id: 2a377cd7e8ec08f0c899dbd9cb3757bec580d30f
This commit is contained in:
Tim Yung authored and Facebook GitHub Bot committed 2025-07-15 20:03:17 -07:00
1 parent 46f3e32019
commit 5050d0a89e
1 file changed
+1 -1
@@ -101,7 +101,7 @@ public class ReactVirtualView(context: Context) :
ReactScrollViewHelper.removeScrollListener(this)
ReactScrollViewHelper.removeLayoutChangeListener(this)
if (detectWindowFocus) {
viewTreeObserver.addOnWindowFocusChangeListener(onWindowFocusChangeListener)
viewTreeObserver.removeOnWindowFocusChangeListener(onWindowFocusChangeListener)
}
cleanupLayoutListeners()
}