Skip to content

🔥 [🐛] initialScrollToFirstUnreadMessage does not work #2591

@ricardojmf

Description

@ricardojmf

Issue

I'm trying to check the default InlineUnreadIndicator but with no success, it does not appear (even if I declare that I'm using it). I research your code base and saw that for it to appear the scrollToBottomButtonVisible should be true which mean that we have to open the chat with lots of unread messages pointed to the first one so that the scroll to button appears on the screen.

Unfortuanatelly this also did not work, I've added the prop initialScrollToFirstUnreadMessage to my <MessageList />component but it does not scroll to the first unread message (I've tested with 30 and 40 unread mesages)

Steps to reproduce

Steps to reproduce the behavior:

Having this config:

<MessageList
  initialScrollToFirstUnreadMessage
  InlineUnreadIndicator={InlineUnreadIndicator}
/>
  1. open up a chat with 40 unread messages
  2. wait for it to point to the first unread message
  3. it does not scroll
  4. it stays at the bottom (most recent message)

Expected behavior

  1. open up a chat with 40 unread messages
  2. wait for it to point to the first unread message
  3. it scrolls
  4. the InlineUnreadIndicator should appear

Project Related Information

Customization

Click To Expand

<MessageList
  initialScrollToFirstUnreadMessage
  InlineUnreadIndicator={InlineUnreadIndicator}
/>

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Click To Expand

package.json:

# N/A

react-native info output:

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1 Pro
  Memory: 255.31 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.2
    path: ~/.nvm/versions/node/v20.12.2/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.2/bin/npm
  Watchman:
    version: 2024.05.06.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/ricardo.figueiredo/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • Platform that you're experiencing the issue on:
    • [] iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:
    • 5.33.1
  • Device/Emulator info:
    • I am using a physical device
    • Device/Emulator: iPhone 13

Additional context

Screenshots

Click To Expand


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions