Skip to content

Fixes the Bug (autoscroll not working) - #23

Open
Ayushraj1605 wants to merge 3 commits into
rishyym0927:mainfrom
Ayushraj1605:feature/amazing-feature
Open

Ayushraj1605 wants to merge 3 commits into
rishyym0927:mainfrom
Ayushraj1605:feature/amazing-feature

Conversation

@Ayushraj1605

@Ayushraj1605 Ayushraj1605 commented Jan 3, 2025 •

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug Fix


Issue Number:

Fixes #18


Did you add tests for your changes?

Not really required


Snapshots:

Screencast.from.2025-01-05.16-34-05.webm

If relevant, did you update the documentation?

Not needed (as it was just a bug fix)


Summary

  • Fixed two major issues in the chat functionality:
    1. Corrected automatic scrolling to only scroll the message container rather than the entire page
    2. Resolved the duplicate messages issue that occurred when sending new messages
  • The changes were implemented in:
    • StoreHUB/storeHUB-fronted/src/pages/Discussion.jsx

Implementation Details

  • Message Container Scrolling:
    • Replaced messagesEndRef with messageContainerRef to target specific container
    • Updated scroll function to use container-specific properties
    • Added small delay to ensure proper DOM updates before scrolling

Verification

The following test cases have been verified:

  1. ✅ Messages container scrolls automatically with new messages
  2. ✅ Scrolling is contained within the message area only
  3. ✅ Messages appear only once when sent
  4. ✅ Smooth transition when scrolling to new messages
  5. ✅ Consistent behavior across different chat channels

Does this PR introduce a breaking change?

No


Other information

None


@vercel

vercel Bot commented Jan 3, 2025

Copy link
Copy Markdown

@Ayushraj1605 is attempting to deploy a commit to the Rishiraj Mukherjee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify

netlify Bot commented Jan 3, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for precious-raindrop-7918a1 ready!

Name Link
🔨 Latest commit 22ee0a7
🔍 Latest deploy log https://app.netlify.com/sites/precious-raindrop-7918a1/deploys/677a6aeed1f57400083bb68f
😎 Deploy Preview https://deploy-preview-23--precious-raindrop-7918a1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rishyym0927

Copy link
Copy Markdown
Owner

@Ayushraj1605 add working video in your PR

@Ayushraj1605

Copy link
Copy Markdown
Author

@rishyym0927 Okay i will.

This branch has not been deployed

No deployments
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.

[BUG] -The automatic scroll is not working properly

2 participants