mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
DEV: Don't error when emoji-picker is used outside composer (#15172)
This commit is contained in:
parent
9ecf454074
commit
7e005f2ea3
|
@ -88,25 +88,24 @@ export default Component.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.site.isMobileDevice) {
|
||||
this._popper = createPopper(
|
||||
document.querySelector(".d-editor-textarea-wrapper"),
|
||||
emojiPicker,
|
||||
{
|
||||
placement: "auto",
|
||||
modifiers: [
|
||||
{
|
||||
name: "preventOverflow",
|
||||
const textareaWrapper = document.querySelector(
|
||||
".d-editor-textarea-wrapper"
|
||||
);
|
||||
if (!this.site.isMobileDevice && textareaWrapper) {
|
||||
this._popper = createPopper(textareaWrapper, emojiPicker, {
|
||||
placement: "auto",
|
||||
modifiers: [
|
||||
{
|
||||
name: "preventOverflow",
|
||||
},
|
||||
{
|
||||
name: "offset",
|
||||
options: {
|
||||
offset: [5, 5],
|
||||
},
|
||||
{
|
||||
name: "offset",
|
||||
options: {
|
||||
offset: [5, 5],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
// this is a low-tech trick to prevent appending hundreds of emojis
|
||||
|
|
Loading…
Reference in New Issue
Block a user