FIX: Prevent emoji-picker from not showing (#7856)

FIX: Prevent emoji-picker from not showing (#7856)

If an external plugin inserts an element with class “emoji-picker”, something probable if they extend EmojiPicker, it could cause troubles as css is added depending on the emoji-picker height. Just by adding a class of a parent

as could be d-editor, we prevent this from happening.
diff --git a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 b/app/assets/javascripts/discourse/components/emoji-picker.js.es6
index 2970f01..0a972e7 100644
--- a/app/assets/javascripts/discourse/components/emoji-picker.js.es6
+++ b/app/assets/javascripts/discourse/components/emoji-picker.js.es6
@@ -565,7 +565,7 @@ export default Ember.Component.extend({
         } else {
           const previewInputOffset = $(".d-editor-input").offset();
 
-          const pickerHeight = $(".emoji-picker").height();
+          const pickerHeight = $(".d-editor .emoji-picker").height();
           const editorHeight = $(".d-editor-input").height();
           const windowBottom = $(window).scrollTop() + $(window).height();

GitHub sha: c5625b70

1 Like