Giter Site home page Giter Site logo

Comments (9)

andreialecu avatar andreialecu commented on May 2, 2024 1

I was able to fix the glitch in #12. I propose we keep the custom snapping code and if someone wants to override they can use disableSnap: true and their own custom snap offsets.

from react-native-collapsible-tab-view.

andreialecu avatar andreialecu commented on May 2, 2024

I guess one reason for using the custom snap code is the ability to override the snapThreshold.

The native snapToOffsets prop has improved behavior and stops momentum scrolling at the snap points, so the header doesn't peek through before snapping back, which may be preferable. Also snapToEnd needs to be set to false.

from react-native-collapsible-tab-view.

andreialecu avatar andreialecu commented on May 2, 2024

May need to verify that it doesn't break cases when the tab content slightly overshoots the window size by less than the snap offset, so it doesn't get stuck offscreen with the list snapping back and not allowing access to it.

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

The snapToOffsets indeed looks like a better solution.

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

I did a quick test on the examples folder, adding snapToOffsets={[0, HEADER_HEIGHT]} to all scrollable components and running on the Collapsible Tab View no snap demo, wich has disableSnap={true}, and it looks like working fine for scroll view, but does not work for flatlist.

The flatlist snaps the header and itself.

from react-native-collapsible-tab-view.

andreialecu avatar andreialecu commented on May 2, 2024

Weird. It works with FlatList in the app I'm working on with no issues. I didn't test the examples folder though, something must be different.

from react-native-collapsible-tab-view.

andreialecu avatar andreialecu commented on May 2, 2024

@PedroBern make sure to also add snapToEnd={false} otherwise the snap points keep repeating for the rest of the list, resulting in weird scrolling behavior.

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

@PedroBern make sure to also add snapToEnd={false} otherwise the snap points keep repeating for the rest of the list, resulting in weird scrolling behavior.

😝 forgot, I will try it again later

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

@andreialecu Can you make a review of #11, please? There was one thing I didn't understand, after fixing #8 and moving to snapToOffsets if I didn't add this line, the albums tab would double in height.

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.