Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.2k stars 463 forks source link

Fix chat scroll jump on message deletion or height change #294

Closed mmd550 closed 7 months ago

mmd550 commented 8 months ago

This pull request addresses an issue where the chat scroll jumps when a message above the viewport is deleted or its height changes due to an edit.

To resolve this problem, I have implemented a solution in the MessageList component. The fix involves setting the anchor to the top element in the viewport. By doing so, we ensure that the scroll position is preserved even if messages above viewport are modified or removed.

Please review the changes and let me know if any further adjustments are needed. I'm open to feedback and eager to collaborate on improving the Telegram Web experience.

Ajaxy commented 8 months ago

This will likely break the logic of infinite scroll, particularly this line. Also, it seems that linter check was ignored.