FIX: forces a reload of emoji list if clicked on more (#7473)

FIX: forces a reload of emoji list if clicked on more (#7473)

This is a bit hacky but it’s much more simple and reliable than many other solutions and doesnt involve having to manage some variable state.

diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6
index 48e3674..bd6c092 100644
--- a/app/assets/javascripts/discourse/components/d-editor.js.es6
+++ b/app/assets/javascripts/discourse/components/d-editor.js.es6
@@ -435,7 +435,14 @@ export default Ember.Component.extend({
             const filterInput = document.querySelector(
               ".emoji-picker input[name='filter']"
             );
-            if (filterInput) filterInput.value = v.term;
+            if (filterInput) {
+              filterInput.value = v.term;
+
+              Ember.run.later(
+                () => filterInput.dispatchEvent(new Event("input")),
+                50
+              );
+            }
           });
 
           return "";

GitHub sha: 5f78bbeb

2 Likes