fix(ios): resync visual state after display:none and window changes#4
Merged
Merged
Conversation
Fabric maps display:'none' to UIView.hidden=YES — no bounds change, no removeFromSuperview, no layoutSubviews. A loading transition that starts while the view is hidden (e.g. React Query cache invalidation during a security lock overlay) could leave the shimmer visible after the subtree becomes visible again. Three changes: 1. _tickWithTime: let transitions always complete even when self.window is nil or view is hidden. Cost is bounded (≤ transitionDuration) and operations are cheap property sets. Shimmer animation (unbounded, cosmetic) still skips when not visible. 2. didMoveToWindow: resync visual state on window re-attachment, mirroring Android's onAttachedToWindow path. Does not snap in-flight transitions — ticks drive those to completion naturally. 3. layoutSubviews else-if (from v1.0.3): force idle state when loading=NO and no transition is running, covering bounds-restoration scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loadingtransitions occur while an ancestor hasdisplay: 'none'(e.g. security lock overlay with React Query cache invalidation)display: 'none'toUIView.hidden = YES— no bounds change, noremoveFromSuperview, nolayoutSubviews— so the v1.0.3 fix alone was insufficientdisplay: 'none'(hidden=YES)_tickWithTime:without!self.windowbail for transitionsdidMoveToWindowlayoutSubviewselse-if!loading && !transitioningContext
PatientStoreLoading: true→falseandPrescriptionsCarousel.isLoading: true→falseduringshowLock: truedisplay: 'none'on content subtree — not a navigation replacementlayoutSubviewsTest plan
display: 'none'while cyclingloadingtrue→falseonTransitionEndfires correctly in all scenarios🤖 Generated with Claude Code