-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
"no container to recycle" and maintainVisibleContentPosition issues #125
Comments
@skaionedev Cannot read property 'coordinate' may be fixed by the #118 |
@michbil I've dynamic height items and my estimated size is 150 px |
@michbil and I couldn't make onReachEnd work properly. It would fire only once and right when sheet opens |
onEndReached is indeed buggy for me as well, but I could fix it with Without a small threshold, it would already fire onEndReach right at the beginning and it will also not reset when scrolling back up. This small value works really well though. |
@skaionedev Could you provide code snippet, at least partially how do you use LegendList inside TrueSheet? |
@hirbod Should we have some sort of minimal list length, at which we should disable onStartReached/onEndReached handlers to avoid misfire of those events? |
Yeah, onEndReach should definitely not fire right after data is added. It should actually scroll, I guess. I just figured out that on Android, 0.1 wasn’t even enough—I had to set it to 0.03, lol. Now it doesn’t fire on load and also resets when scrolling all the way down and back up. I think there’s some logic issue or bug. |
import { TrueSheet } from "@lodev09/react-native-true-sheet";
import { useRef } from "react";
import { TouchableOpacity, View } from "react-native";
import { Text } from "~/shared/ui";
const items = []; // mock data, in my app I'm using Bible verses in references list( from 1 - 8k items)
export const Test = () => {
const sheetRef = useRef<TrueSheet>(null);
return (
<>
<View>
<TouchableOpacity>
<Text>open sheet</Text>
</TouchableOpacity>
</View>
<TrueSheet sizes={['large']} ref={sheetRef}>
<LegendList
data={items}
renderItem={({ item }) => (
//item height should be dynamic
<View>
<Text>{item.title}</Text>
<Text>{item.description}</Text>
</View>
)}
estimatedItemSize={150}
recycleItems
/>
</TrueSheet>
</>
);
}; |
@skaionedev It looks like LegendList is trying to get a really lot of the space inside of TrueSheet From the true sheet documentation, it says it doesn't really work well with flex:1 layouts, and LegendList requires to know your window height to work correctly. @jmeistrich Any idea how to make it work? Only way for me to make it work somehow properly is to remove scrollRef={scrollview} and assign fixed height to the LegendList. FYI my test rig for the issue.
|
I'm trying to render LegendList inside TrueSheet and having this issues
The text was updated successfully, but these errors were encountered: