FIX: Keep composer title and reply when switching to PM (#9851)

FIX: Keep composer title and reply when switching to PM (#9851)

diff --git a/app/assets/javascripts/select-kit/addon/components/composer-actions.js b/app/assets/javascripts/select-kit/addon/components/composer-actions.js
index adaccf2..98cb3fc 100644
--- a/app/assets/javascripts/select-kit/addon/components/composer-actions.js
+++ b/app/assets/javascripts/select-kit/addon/components/composer-actions.js
@@ -328,6 +328,7 @@ export default DropdownSelectBoxComponent.extend({
           this.composerModel.getProperties(
             "draftKey",
             "draftSequence",
+            "title",
             "reply",
             "disableScopedCategory"
           ),
diff --git a/test/javascripts/acceptance/composer-actions-test.js b/test/javascripts/acceptance/composer-actions-test.js
index fff2e80..95060ba 100644
--- a/test/javascripts/acceptance/composer-actions-test.js
+++ b/test/javascripts/acceptance/composer-actions-test.js
@@ -19,6 +19,24 @@ acceptance("Composer Actions", {
   }
 });
 
+QUnit.test(
+  "creating new topic and then reply_as_private_message keeps attributes",
+  async assert => {
+    await visit("/");
+    await click("button#create-topic");
+
+    await fillIn("#reply-title", "this is the title");
+    await fillIn(".d-editor-input", "this is the reply");
+
+    const composerActions = selectKit(".composer-actions");
+    await composerActions.expand();
+    await composerActions.selectRowByValue("reply_as_private_message");
+
+    assert.ok(find("#reply-title").val(), "this is the title");
+    assert.ok(find(".d-editor-input").val(), "this is the reply");
+  }
+);
+
 QUnit.test("replying to post", async assert => {
   const composerActions = selectKit(".composer-actions");
 

GitHub sha: e31adef3

This commit appears in #9851 which was approved by ZogStriP. It was merged by SamSaffron.