Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not processing Visibility events on parent LithoView when it has …
…transient child LithoViews Summary: We process our visibility evens in 2 cases: `Extension.afterMount` or `Extension.onVisibleBoundsChanged`. In both cases if the view is in transient state, we skip processing until it's not. We rely on `setHasTransientState(false)` to be called eventually to return the view back to non transient state. But in realty `setHasTransientState(true)` is not the only was to make a view transient. It transitively becomes transient, when any of its children becomes transient. This was the case in the issue that uncovered this bug — child LithoViews sometimes were in transient state in `afterMount` or `onVisibleBoundsChanged`, resulting in parent LithoView skipping processing visibility. But since the parent view was never marked as transient itself, it never had `setHasTransientState(false)` called as well, and we didn't process visibility until the next `afterMount` or `onVisibleBoundsChanged` when all children were back to non-transient state. View has a dedicated `childHasTransientStateChanged` to be notified about its children transient state changes, which is being hooked up in this diff to trigger visibility processing when parent's effective transient state is back to `false`. Reviewed By: adityasharat Differential Revision: D47841143 fbshipit-source-id: 9a65469ac09af23bb2f2586539b074f5cc5cb1eb
- Loading branch information