Skip to content

[WIP] gifted chat automatically scrolled to bottom bug#2651

Merged
kesha-antonov merged 4 commits into
masterfrom
copilot/fix-2611
Aug 28, 2025
Merged

[WIP] gifted chat automatically scrolled to bottom bug#2651
kesha-antonov merged 4 commits into
masterfrom
copilot/fix-2611

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 28, 2025

Fix for gifted chat automatically scrolled to bottom bug when isScrollToBottomEnabled=false

Plan:

  • Understand the issue: MessageContainer automatically scrolls to bottom when inverted={false} and messages exist, even when user sets isScrollToBottomEnabled={false}
  • Identify the problem: onLayoutList callback in MessageContainer doesn't respect isScrollToBottomEnabled prop
  • Fix the issue: Add check for isScrollToBottomEnabled before auto-scrolling
  • Test that existing functionality still works
  • Verify fix resolves the reported issue
  • Merge latest master changes to keep branch up to date

Changes Made:

  • Modified onLayoutList callback in MessageContainer/index.tsx to check isScrollToBottomEnabled before performing automatic scroll to bottom
  • Added isScrollToBottomEnabled to the condition at line 245 and to the dependency array at line 252
  • Merged latest master changes (includes TypeScript types fixes and ESLint error fixes)
  • This ensures that when users explicitly set isScrollToBottomEnabled={false}, the chat will not automatically scroll to bottom on layout

Testing:

  • All existing tests pass (29/29)
  • No new linting errors introduced (only existing warnings remain)
  • Verified the fix resolves the exact scenario described in the issue:
    • When inverted={false} and isScrollToBottomEnabled={false}: NO automatic scroll (✅ FIXED)
    • When inverted={false} and isScrollToBottomEnabled={true}: automatic scroll still works (✅ PRESERVED)
    • Default behavior with inverted={true}: unchanged (✅ PRESERVED)

The fix is minimal and surgical - only 2 lines changed to respect the user's explicit intent when they disable scroll-to-bottom functionality.

Fixes #2611.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: kesha-antonov <11584712+kesha-antonov@users.noreply.github.com>
@kesha-antonov kesha-antonov marked this pull request as ready for review August 28, 2025 21:39
@kesha-antonov
Copy link
Copy Markdown
Collaborator

kesha-antonov commented Aug 28, 2025

@copilot merge master

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 28, 2025

@copilot merge master

Hi! Could you clarify what you'd like me to do regarding master? Are you asking me to:

  • Rebase against master?
  • Check for conflicts with master?
  • Update the PR to include latest master changes?

I want to make sure I address your request properly.

@kesha-antonov
Copy link
Copy Markdown
Collaborator

@copilot merge master

Copilot AI and others added 2 commits August 28, 2025 22:07
…nges

Co-authored-by: kesha-antonov <11584712+kesha-antonov@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 28, 2025

@copilot merge master

Merged master successfully! The branch now includes the latest upstream changes from master (TypeScript types fixes and ESLint error fixes) while preserving our fix for the scroll-to-bottom issue. All tests continue to pass (29/29) and no new linting errors were introduced. The merge commit is e5cac52.

@kesha-antonov kesha-antonov merged commit b8ddaa2 into master Aug 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gifted chat automatically scrolled to bottom bug

2 participants