RocketChat / Rocket.Chat.ReactNative

Rocket.Chat mobile clients
https://rocket.chat
MIT License
2.02k stars 1.18k forks source link

fix: message view auto scrolls up when swiped up #5551

Open preeesha opened 9 months ago

preeesha commented 9 months ago

Description:

When the chat is at its bottom, if user swipes up a couple of times (3-4, sometimes 2 also), the message view scrolls up.

Environment Information:

Steps to reproduce:

  1. Open any chat view
  2. Swipe up a couple of times
  3. Observe chat going up

Expected behavior:

This is an unexpected behaviour. Chat must remain at the bottom.

Actual behavior:

https://github.com/RocketChat/Rocket.Chat.ReactNative/assets/126406840/23f446d4-9f21-4da8-ad61-3c8dff61a3f5

preeesha commented 9 months ago

@GleidsonDaniel, @diegolmello Please let me know your views on this one. I would love to work on this.

Thanks for your time and consideration Prisha Gupta

dnlsilva commented 9 months ago

I managed to reproduce it, but I don't think it's something simple to solve hahaha. However, nothing stops you from wanting to work on it 😅.

diegolmello commented 9 months ago

Pretty sure it's related to FlatList inverted https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/b189f59950807b2359c818a9b051140550a00362/app/views/RoomView/List/index.tsx#L20

We've been patching it to fix inverted behavior (for both ScrollView and RefreshControl) while keeping it fast over the years, but right now we removed them completely and we're just applying Container above.

Since we're using stock FlatList now, removing Container should fix the issue, right? We need to test. Does this happen with FlashList?