Giter Site home page Giter Site logo

Comments (6)

alexpchin avatar alexpchin commented on May 2, 2024

Can we perhaps resolve this using flexGrow: 1 instead of using minHeight?

Example, removing the calculated containerHeight from props, not updated in CollapsibleTabView.

export const AnimatedContacts = React.forwardRef<
  any,
  React.PropsWithoutRef<CollapsibleScenePropsAndRef>
>(({ contentContainerStyle, ...rest }, ref) => {
  const [isRefreshing, startRefreshing] = useRefresh();

  const contentContainerStyleProp = {
    paddingTop: contentContainerStyle.paddingTop || 0,
    flexGrow: 1,
  };

  return (
    <Animated.FlatList
      ref={ref}
      data={CONTACTS}
      keyExtractor={(_, i) => String(i)}
      renderItem={renderItem}
      ItemSeparatorComponent={ItemSeparator}
      ListEmptyComponent={ListEmptyComponent}
      refreshing={isRefreshing}
      onRefresh={startRefreshing}
      contentContainerStyle={contentContainerStyleProp}
      {...rest}
    />
  );
});

Gives:

Screenshot 2020-12-08 at 13 38 43

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

@alexpchin I'm not with the project open right now, I will check it later, but I think removing the minHeight will re-introduce a bug in case of the content being smaller than the screen height (#8). Can you check this by adding the same contentContainerStyleProp to the SmallContentExample ?

from react-native-collapsible-tab-view.

alexpchin avatar alexpchin commented on May 2, 2024

@PedroBern Yes, you are correct. It does create a gap at the top when scrolling between tabs. I will look into it further now.

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

@alexpchin check out the #22 preview, please let me know if it is working for you or if you have something to add. When you say it's ok I will merge and release 🚀

expo.io/@pedrobern/react-native-collapsible-tab-view-demos?release-channel=pr-22

from react-native-collapsible-tab-view.

alexpchin avatar alexpchin commented on May 2, 2024

@PedroBern is the man. 🚀

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

released in v1.4.1 🚀

from react-native-collapsible-tab-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.