DEV: Don't error when emoji-picker is used outside composer (#15172)

This commit is contained in:
Mark VanLandingham 2021-12-02 14:50:30 -06:00 committed by GitHub
parent 9ecf454074
commit 7e005f2ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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