ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.24k stars 429 forks source link

ListView displays in reverse order #120

Closed theneverstill closed 7 years ago

theneverstill commented 7 years ago

This can be observed in UIExplorer.

knoopx commented 7 years ago

I have been experiencing that same issue since the first time at tried react native desktop too.

On Fri, Sep 30, 2016, 14:30 Lucas Still notifications@github.com wrote:

This can be observed in UIExplorer.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ptmt/react-native-macos/issues/120, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKgbkGYHUN48jnQ7SzA1pVO2MLCYoRks5qvQDngaJpZM4KLCUC .

theneverstill commented 7 years ago

In /Libraries/CustomComponents/ListView/ListView.js

a) The prop autoScrollToBottom is a misnomer b) If I switch the order in the "prepend items" section, it appears to render correctly

if (this.props.autoScrollToBottom) { bodyComponents.push(row); } else { bodyComponents = [row].concat(bodyComponents); }

ptmt commented 7 years ago

You answered quicker than I have fixed. : ) Yes, this is because of autoScrollToBottom property (there is the other line too with reverse index).

ptmt commented 7 years ago

This hack was introduced because ios solution to achieve "chat window reverse order" (translateY: -1) doesn't work well on macOS. It seems that ListView order has been broken after a pretty inaccurate merge with latest RN and hasn't got properly tested. Thank you again for reporting.

theneverstill commented 7 years ago

I can't even begin to explain how much of a positive performance impact this has made on my app. Now listviews only render rows once. :)

ptmt commented 7 years ago

Don't hesitate to open as many issues as you want here and feel free to reach me out in any way. I don't have many hours dedicated to RN macOS right now, but I still have big plans and willing to fix bugs and improve performance. And sometimes a bug can turn out into a simple fix as this : )

theneverstill commented 7 years ago

A console.log accidentally got left in the commit/fix.

ptmt commented 7 years ago

fixed On Fri, 30 Sep 2016 at 17:28, Lucas Still notifications@github.com wrote:

A console.log accidentally got left in the commit/fix.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/ptmt/react-native-macos/issues/120#issuecomment-250758655, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9SU8IDmpxH1eXQwP611IElYO_RtIPXks5qvRyFgaJpZM4KLCUC .