bilal1031 / expo-insta-story

MIT License
2 stars 4 forks source link

scrolling to prev stories #1

Closed denys-anosov closed 6 months ago

denys-anosov commented 6 months ago

Hi, I want to use this library for my React Native project and have a question about scrolling.

So, the issue I'm facing is - when I press a story that's not the first one in the array of stories, I can't scroll back to previous stories that come before it.

For example, if I have an array of 5 stories [1, 2, 3, 4, 5] and press to view story number 3, then I'm not able to scroll back to stories nr. 2 and 1, I can only scroll to stories that come after 3.

Here is a video showcasing the issue.

https://github.com/bilal1031/expo-insta-story/assets/90140038/726cd7c1-7d34-4709-95fa-daf3946212d0

Maybe you know how I can modify the library's behavior to be able to scroll to previous stories in this case?

Thanks in advance!

bilal1031 commented 6 months ago

Hi @denys-anosov, I looked into the issue and fixed it. However, there is a new problem after changes that may take time to fix as it is a react rendering issue for the first time when we try to open the modal. It might be a fluke but it requires further testing. I would recommend having a contributor from the react-native-insta-story look into this. I made the updated changes in the GitHub repo. You can fork it and checkout if this solves your problem.

denys-anosov commented 6 months ago

@bilal1031 Thanks for the fix. Unfortunately, I'm also experiencing a rendering issue for the first time when I open the modal. But scrolling to previous stories now works. I'm going to close the issue for now. Thank you.

bilal1031 commented 6 months ago

@denys-anosov, I will take time to understand to fix it. I got the reason why it is causing it. But need to come up with a solution for it. I can give you a heads-up if you want to fix it.

If I have an array of five stories [1, 2, 3, 4, 5] and I click to view story number three, the value of x updates as soon as the modal loads up. However, during that time, the view that shows the story is not completely rendered yet, so it displays a black screen initially. Ideally, we want the value to be updated when the render is complete. Additionally, we need control over where we want to take it, such as to story number two or five.