Skip to content

fix(ios,android): resync visual state after ancestor display:none removal#5

Merged
RamboWasReal merged 1 commit into
mainfrom
fix/ancestor-visibility-resync
Apr 1, 2026
Merged

fix(ios,android): resync visual state after ancestor display:none removal#5
RamboWasReal merged 1 commit into
mainfrom
fix/ancestor-visibility-resync

Conversation

@RamboWasReal
Copy link
Copy Markdown
Owner

Summary

  • iOS: Add KVO observer on self.hidden to detect YES→NO transitions (ancestor display: 'none' removal) and resync shimmer/content state
  • Android: Override onVisibilityChanged to detect VISIBLE transitions and resync shimmer/content state
  • Bump version to 1.0.5

Context

Fabric maps ancestor display: 'none' to UIView.hidden=YES (iOS) / View.setVisibility(INVISIBLE) (Android). These bypass existing didMoveToWindow / onAttachedToWindow hooks, leaving GleamView stuck in the wrong visual state when the ancestor becomes visible again.

Files changed

File Change
ios/GleamView.mm KVO setup/teardown + observeValueForKeyPath: handler
android/.../GleamView.kt onVisibilityChanged() override
package.json Version bump 1.0.4 → 1.0.5
CHANGELOG.md v1.0.5 entry

Test plan

  • Wrap GleamView in a parent that toggles display: 'none'
  • Set loading={true}, hide parent, set loading={false}, unhide parent → content visible, no stuck shimmer
  • Verify rapid show/hide cycles don't cause crashes
  • Verify existing shimmer + transition behavior unchanged on both platforms
  • Run yarn test — 88 tests pass, yarn typecheck + yarn lint clean

…oval

Fabric maps ancestor `display: 'none'` to hidden/visibility changes that
bypass existing didMoveToWindow/onAttachedToWindow hooks, leaving GleamView
stuck in the wrong visual state when the ancestor becomes visible again.

- iOS: KVO observer on `self.hidden` detects YES→NO transitions and resyncs
- Android: `onVisibilityChanged` override detects VISIBLE transitions and resyncs
@RamboWasReal RamboWasReal merged commit ec4401f into main Apr 1, 2026
4 checks passed
@RamboWasReal RamboWasReal deleted the fix/ancestor-visibility-resync branch April 1, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant