Skip to content

Update ChatComponent scroll behavior to only target its own component#6

Open
Mohammadsaknini wants to merge 3 commits into
gbolly:mainfrom
Mohammadsaknini:scroll-bugfix
Open

Update ChatComponent scroll behavior to only target its own component#6
Mohammadsaknini wants to merge 3 commits into
gbolly:mainfrom
Mohammadsaknini:scroll-bugfix

Conversation

@Mohammadsaknini

Copy link
Copy Markdown

The problem occurs when multiple scrollable elements are present, which causes all of them to scroll.

@songholmes

Copy link
Copy Markdown

Hi @Mohammadsaknini, I found the component unconditionally calls scrollIntoView, so each new message drags the whole page back to the chat. Will this relate to your findings?

@Mohammadsaknini

Copy link
Copy Markdown
Author

Exactly, The problem is that the default block behavior of the scrollIntoView function, adjust it to nearest and it should solve the issue.

@songholmes

Copy link
Copy Markdown

Exactly, The problem is that the default block behavior of the scrollIntoView function, adjust it to nearest and it should solve the issue.

I see, thanks for your reply and solution!

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.

2 participants