A platform for community discussion. Free, open, simple.
FIX: scroll top after chat activation (#21952)
Joffrey JAFFEUX41fb88c7e0c7
diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat.js b/plugins/chat/assets/javascripts/discourse/routes/chat.jsindex a02baa97692..f5d9c9f7809 100644--- a/plugins/chat/assets/javascripts/discourse/routes/chat.js+++ b/plugins/chat/assets/javascripts/discourse/routes/chat.js@@ -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();});}}diff --git a/plugins/chat/spec/system/list_channels/mobile_spec.rb b/plugins/chat/spec/system/list_channels/mobile_spec.rbindex 630424f0dd8..4d8c4c83fb4 100644--- a/plugins/chat/spec/system/list_channels/mobile_spec.rb+++ b/plugins/chat/spec/system/list_channels/mobile_spec.rb@@ -4,6 +4,7 @@ RSpec.describe "List channels | mobile", type: :system, mobile: true dofab!(:current_user) { Fabricate(:user) }let(:chat) { PageObjects::Pages::Chat.new }+ let(:topic_page) { PageObjects::Pages::Topic.new }before dochat_system_bootstrapdiff --git a/plugins/chat/spec/system/reply_to_message/drawer_spec.rb b/plugins/chat/spec/system/reply_to_message/drawer_spec.rbindex 555b4ca24f5..4cc9dc6766e 100644--- a/plugins/chat/spec/system/reply_to_message/drawer_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/drawer_spec.rb@@ -29,10 +29,9 @@ RSpec.describe "Reply to message - channel - drawer", type: :system doexpect(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 doexpect(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.backexpect(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")endend@@ -91,10 +89,9 @@ RSpec.describe "Reply to message - channel - drawer", type: :system dotext: 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")endendenddiff --git a/plugins/chat/spec/system/reply_to_message/mobile_spec.rb b/plugins/chat/spec/system/reply_to_message/mobile_spec.rbindex bc79c145022..3e778bb5665 100644--- a/plugins/chat/spec/system/reply_to_message/mobile_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/mobile_spec.rb@@ -89,7 +89,7 @@ RSpec.describe "Reply to message - channel - mobile", type: :system, mobile: truchannel_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")endendend