From cbf3f3a908948b1f2a7e94884a9a645d0baf2a78 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 24 Apr 2024 15:54:38 +0200 Subject: [PATCH] FIX: ensures ctrl+enter from textarea saves (#566) --- .../components/modal/edit-topic-assignments.gjs | 5 ++++- .../discourse/components/topic-assignments.gjs | 2 +- spec/system/assign_topic_spec.rb | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs b/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs index 185faa34..768bf71d 100644 --- a/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs +++ b/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs @@ -47,7 +47,10 @@ export default class EditTopicAssignments extends Component { diff --git a/spec/system/assign_topic_spec.rb b/spec/system/assign_topic_spec.rb index 1eb9ab88..b30a5b77 100644 --- a/spec/system/assign_topic_spec.rb +++ b/spec/system/assign_topic_spec.rb @@ -35,6 +35,20 @@ expect(page).to have_no_css("#topic .assigned-to") end + it "can submit form with shortcut from texatea" do + visit "/t/#{topic.id}" + + topic_page.click_assign_topic + assign_modal.assignee = staff_user + + find("body").send_keys(:tab) + find("body").send_keys(:control, :enter) + + expect(assign_modal).to be_closed + expect(topic_page).to have_assigned(user: staff_user, at_post: 2) + expect(find("#topic .assigned-to")).to have_content(staff_user.username) + end + context "when assigns are not public" do before { SiteSetting.assigns_public = false }