FIX: scroll top after chat activation (#21952)
Currently navigating a long topic and then opening chat would cause the view to be scrolled to the bottom. Using `scrollTop` here ensures we correctly scroll to top. This had been incorrectly moved into `deactivate` during another change.
This commit is contained in:
parent
89d7b1861d
commit
41fb88c7e0
|
@ -62,6 +62,7 @@ export default class ChatRoute extends DiscourseRoute {
|
|||
schedule("afterRender", () => {
|
||||
document.body.classList.add("has-full-page-chat");
|
||||
document.documentElement.classList.add("has-full-page-chat");
|
||||
scrollTop();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -77,7 +78,6 @@ export default class ChatRoute extends DiscourseRoute {
|
|||
schedule("afterRender", () => {
|
||||
document.body.classList.remove("has-full-page-chat");
|
||||
document.documentElement.classList.remove("has-full-page-chat");
|
||||
scrollTop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ RSpec.describe "List channels | mobile", type: :system, mobile: true do
|
|||
fab!(:current_user) { Fabricate(:user) }
|
||||
|
||||
let(:chat) { PageObjects::Pages::Chat.new }
|
||||
let(:topic_page) { PageObjects::Pages::Topic.new }
|
||||
|
||||
before do
|
||||
chat_system_bootstrap
|
||||
|
|
|
@ -29,10 +29,9 @@ RSpec.describe "Reply to message - channel - drawer", type: :system do
|
|||
|
||||
expect(drawer_page).to have_open_thread
|
||||
|
||||
thread_page.fill_composer("reply to message")
|
||||
thread_page.click_send_message
|
||||
thread_page.send_message("reply to message")
|
||||
|
||||
expect(thread_page).to have_message(text: "reply to message")
|
||||
expect(thread_page.messages).to have_message(text: "reply to message")
|
||||
|
||||
drawer_page.back
|
||||
|
||||
|
@ -64,16 +63,15 @@ RSpec.describe "Reply to message - channel - drawer", type: :system do
|
|||
|
||||
expect(drawer_page).to have_open_thread
|
||||
|
||||
thread_page.fill_composer("reply to message")
|
||||
thread_page.click_send_message
|
||||
thread_page.send_message("reply to message")
|
||||
|
||||
expect(thread_page).to have_message(text: message_1.message)
|
||||
expect(thread_page).to have_message(text: "reply to message")
|
||||
expect(thread_page.messages).to have_message(text: message_1.message)
|
||||
expect(thread_page.messages).to have_message(text: "reply to message")
|
||||
|
||||
drawer_page.back
|
||||
|
||||
expect(channel_page).to have_thread_indicator(original_message, text: "2")
|
||||
expect(channel_page).to have_no_message(text: "reply to message")
|
||||
expect(channel_page.messages).to have_no_message(text: "reply to message")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -91,10 +89,9 @@ RSpec.describe "Reply to message - channel - drawer", type: :system do
|
|||
text: original_message.excerpt,
|
||||
)
|
||||
|
||||
channel_page.fill_composer("reply to message")
|
||||
channel_page.click_send_message
|
||||
channel_page.send_message("reply to message")
|
||||
|
||||
expect(channel_page).to have_message(text: "reply to message")
|
||||
expect(channel_page.messages).to have_message(text: "reply to message")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -89,7 +89,7 @@ RSpec.describe "Reply to message - channel - mobile", type: :system, mobile: tru
|
|||
channel_page.fill_composer("reply to message")
|
||||
channel_page.click_send_message
|
||||
|
||||
expect(channel_page).to have_message(text: "reply to message")
|
||||
expect(channel_page.messages).to have_message(text: "reply to message")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue