Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skeleton placeholder doesn't resize with parent container #127

Open
ltsai-tb opened this issue Dec 4, 2023 · 1 comment
Open

Skeleton placeholder doesn't resize with parent container #127

ltsai-tb opened this issue Dec 4, 2023 · 1 comment

Comments

@ltsai-tb
Copy link

ltsai-tb commented Dec 4, 2023

If the parent container of the skeleton placeholder changes width and the placeholder takes a width based on its parent, the placeholder only resizes on iOS on decrease instead of dynamic increase/decrease for both platforms.

  const handleLayout = (event) => {
    const { width } = event.nativeEvent.layout;
    setLoaderWidth(width - 100)
  };

  return (
    <View >
      <View width={containerWidth} onLayout={handleLayout}>
        <SkeletonPlaceholder>
          <SkeletonPlaceholder.Item width={loaderWidth} height={200} />
        </SkeletonPlaceholder>
      </View>
    </View>
  );

video -
Android
android.skeleton.loader.test.mov
Fixed on container width increase and decrease
iOS
ios.skeleton.loader.test.mp4
Fixed on container width increase, dynamic on decrease
@mathewpatten
Copy link

Having issues with this as well relating to orientation change

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

No branches or pull requests

2 participants