necolas / react-native-web

Cross-platform React UI packages
https://necolas.github.io/react-native-web
MIT License
21.63k stars 1.79k forks source link

The scrollEnabled prop does not work on inverted flatlists #2543

Open gwesseling opened 1 year ago

gwesseling commented 1 year ago

Is there an existing issue for this?

Describe the issue

The scrollEnabled prop on a scrollview does not work when the inverted prop is also set on flatlist.

Expected behavior

The expected behaviour would be that the flatlist/scrollview should prevent the user from scrolling.

Steps to reproduce

Browser: Chrome on MacOS (webkit) React-native-web: 0.19.1 React: 18.2 React-dom: 18.2

Add inverted and scrollEnabled={false} to a Flatlist, such as <FlatList data={items} renderItem={renderItem} inverted scrollEnabled={false} />

Test case

https://codesandbox.io/s/rnw-nestedtextinputscroll-forked-l4rzz2?file=/src/App.js:728-741

Additional comments

No response

Babur171 commented 1 year ago

@gwesseling By default, when using an inverted FlatList, the scrollEnabled prop may not behave as expected due to the reverse nature of the scrolling.

To overcome this limitation, you can try implementing a workaround by using the inverted prop along with the transform style property.

gwesseling commented 1 year ago

Thanks for your response. I am aware of this and implemented a workaround. I figured I would report the issue either way :)

devkumar4 commented 1 year ago

I would be happy to work on this issue with you. I have a lot of experience in this area, and I am confident that I can help you find a solution.

What is the specific issue that you are facing? Once I have a better understanding of the problem, I can start to brainstorm some ideas. I will also need to know what resources you have available to you, so that I can tailor my suggestions accordingly.

I am confident that we can work together to find a solution that is both effective and efficient. I am available to start working on this issue immediately. Please let me know if you have any questions.