UX: fills picker with emoji autocomplete state on `more` click (#7466)

UX: fills picker with emoji autocomplete state on more click (#7466)

diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6
index ebba5d7..48e3674 100644
--- a/app/assets/javascripts/discourse/components/d-editor.js.es6
+++ b/app/assets/javascripts/discourse/components/d-editor.js.es6
@@ -426,11 +426,18 @@ export default Ember.Component.extend({
           return `${v.code}:`;
         } else {
           $editorInput.autocomplete({ cancel: true });
-          this.set(
-            "isEditorFocused",
-            $("textarea.d-editor-input").is(":focus")
-          );
-          this.set("emojiPickerIsActive", true);
+          this.setProperties({
+            isEditorFocused: $("textarea.d-editor-input").is(":focus"),
+            emojiPickerIsActive: true
+          });
+
+          Ember.run.schedule("afterRender", () => {
+            const filterInput = document.querySelector(
+              ".emoji-picker input[name='filter']"
+            );
+            if (filterInput) filterInput.value = v.term;
+          });
+
           return "";
         }
       },
@@ -477,7 +484,7 @@ export default Ember.Component.extend({
           )
           .then(list => {
             if (list.length) {
-              list.push({ label: I18n.t("composer.more_emoji") });
+              list.push({ label: I18n.t("composer.more_emoji"), term });
             }
             return list;
           });

GitHub sha: ae493f47

1 Like

This works :+1: but it doesn’t pre-filter the emoji modal with the pre-filled text. Can that also be fixed?

It should do it :thinking: whats your os/browser?

Windows 10 / Latest Chrome.

1 Like