mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
message_edit: Scroll back to original position after closing edit form.
This commit changes the code to scroll to the top after closing the message edit form to make sure the cursor it at same position and the scroll does not distract the user when the request of message edit is processing. Though the scrolling is not visible distinctly in much case and is visible only when there is some delay, but it is fine to change this code as the logic is correct and to be on safer side.
This commit is contained in:
@@ -656,7 +656,7 @@ export function end_message_row_edit(row) {
|
||||
const message = message_lists.current.get(rows.id(row));
|
||||
if (message !== undefined && currently_editing_messages.has(message.id)) {
|
||||
const scroll_by = currently_editing_messages.get(message.id).scrolled_by;
|
||||
message_viewport.scrollTop(message_viewport.scrollTop() - scroll_by);
|
||||
const original_scrollTop = message_viewport.scrollTop();
|
||||
|
||||
// Clean up resize event listeners
|
||||
const listeners = currently_editing_messages.get(message.id).listeners;
|
||||
@@ -671,6 +671,7 @@ export function end_message_row_edit(row) {
|
||||
|
||||
currently_editing_messages.delete(message.id);
|
||||
message_lists.current.hide_edit_message(row);
|
||||
message_viewport.scrollTop(original_scrollTop - scroll_by);
|
||||
|
||||
compose.abort_video_callbacks(message.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user