Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the scroll position of the chat view in the sidebar #1302

Merged

Conversation

danxuliu
Copy link
Member

When the chat view was in the sidebar, the scroll position of the chat view was reset to the top every time that the sidebar was closed and opened again or the chat tab was selected after changing to a different one.

The reason is that detaching an element and attaching it again, which happens in both scenarios, resets the scroll position of the element, so now the scroll position is explicitly saved before closing the sidebar or unselecting the chat tab and restored again after opening the sidebar or selecting the chat tab again.

How to test (scenario 1):

  • Start a call
  • Write enough messages in the chat to make the scroll bar appear
  • Select the Participants tab
  • Select the Chat tab

How to test (scenario 2):

  • Start a call
  • Write enough messages in the chat to make the scroll bar appear
  • Close the sidebar
  • Open the sidebar

Expected result:
The scroll position of the list of messages is the same as before.

Actual result:
The list of messages is scrolled to the top.

The calls to the default methods from the server to open and close the
sidebar had to be replaced by their implementation to be able to also
trigger an event when the animation ends.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Calling "restoreScrollPosition" twice caused the chat view to be
scrolled to the top due to not taking into account the current scroll
position.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When the chat view was in the sidebar, the scroll position of the chat
view was reset to the top every time that the sidebar was closed and
opened again or the chat tab was selected after changing to a different
one.

The reason is that detaching an element and attaching it again, which
happens in both scenarios, resets the scroll position of the element, so
now the scroll position is explicitly saved before closing the sidebar
or unselecting the chat tab and restored again after opening the sidebar
or selecting the chat tab again.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants