MessageKit / MessageKit/MessageKit

scrollToLastItem(at:animated:) is not scrolling to bottom properly.

Open
#1,830 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug?
Dominant language
Swift
Stars
6.3k
Forks
1.2k
Avg merge
12h 4m
Merged PRs (30d)
9

Description

The Bug
The scrollToLastItem(at:animated:) method is not scrolling to the bottom properly. It eliminates the gap between last cell and inputBarAccessoryView. This issue is visible in the video I recorded from the Example app of MessageKit. It seems the method only makes the last item completely visible without considering the bottom inset and eliminates the space between the inputBarAccessoryView and the message cell.

To Reproduce
Open Example MessageKit app, open Basic Example screen, wait for bots to send message, or you can send yourself, messagesCollectionView will scroll to bottom automatically. Then try to scroll manually, it will scroll a little bit more, which is expected when programatically scrolled.

Expected behavior
The gap between inputBarAccessoryView messagesCollectionView should be kept when programatically scrolled.

Screenshots
Simulator Screen Recording - iPhone 15 Pro Max - 2024-02-14 at 04 16 50

Environment

  • What version of MessageKit are you using?
    4.2.0 (commit c7f278c)

  • What version of iOS are you running on?
    IOS 17.0.1 on Simulator iPhone 15 Pro Max
    IOS 17.2.1 on Physical Device iPhone 13

  • What version of Swift are you running on?
    Swift 5.9

  • What device(s) are you testing on? Are these simulators?
    IOS 17.0.1 on Simulator iPhone 15 Pro Max
    IOS 17.2.1 on Physical Device iPhone 13

  • Is the issue you're experiencing reproducible in the example app?
    Yes.

(I don't know why but GIF is not repeating, you can see it after refresh)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the Example app's Basic Example screen, then trace the scrollToLastItem(at:animated:) entry point and its handling of the collection view's bottom inset. Compare programmatic scrolling with manual scrolling. Done means the gap between the last message cell and inputBarAccessoryView remains after automatic scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.