From 81a893b556bbd4e5a73dd41b3dad92915cb06119 Mon Sep 17 00:00:00 2001
From: Saturnino Abril <saturnino.abril@gmail.com>
Date: Thu, 6 Jul 2017 04:21:04 +0800
Subject: fix position of emoji picker (#6837)

---
 webapp/components/emoji_picker/emoji_picker.jsx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'webapp/components/emoji_picker/emoji_picker.jsx')

diff --git a/webapp/components/emoji_picker/emoji_picker.jsx b/webapp/components/emoji_picker/emoji_picker.jsx
index 2a5b84747..a047c1277 100644
--- a/webapp/components/emoji_picker/emoji_picker.jsx
+++ b/webapp/components/emoji_picker/emoji_picker.jsx
@@ -31,11 +31,18 @@ const CATEGORIES = [
 export default class EmojiPicker extends React.Component {
     static propTypes = {
         style: PropTypes.object,
+        rightOffset: PropTypes.number,
+        topOffset: PropTypes.number,
         placement: PropTypes.oneOf(['top', 'bottom', 'left']),
         customEmojis: PropTypes.object,
         onEmojiClick: PropTypes.func.isRequired
     }
 
+    static defaultProps = {
+        rightOffset: 0,
+        topOffset: 0
+    };
+
     constructor(props) {
         super(props);
 
@@ -299,13 +306,17 @@ export default class EmojiPicker extends React.Component {
                 pickerStyle = {
                     top: this.props.style.top,
                     bottom: this.props.style.bottom,
-                    right: 1
+                    right: this.props.rightOffset
                 };
             } else {
                 pickerStyle = this.props.style;
             }
         }
 
+        if (pickerStyle && pickerStyle.top) {
+            pickerStyle.top += this.props.topOffset;
+        }
+
         return (
             <div
                 className='emoji-picker'
-- 
cgit v1.2.3-1-g7c22

