Search code examples
javascriptjqueryemojione

Displaying emojionearea emoji container at the bottom of textarea


I just applied emojionearea.js to my textarea but emoji are been displayed at the top of my textarea, hiding its view from users.

enter image description here

I will like to know how to position its container to the bottom of my textarea.

my code :

$(document).ready(function() {
  $(".emoji_act").emojioneArea({
    emojiPlaceholder: ":smile_cat:",
    searchPlaceholder: "Search",
    buttonTitle: "Use your TAB key to insert emoji faster",
    searchPosition: "bottom",
  });
});
<link href="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.css" rel="stylesheet" />
<div class="container-fluid pt-3">
  <form method="POST" action="" enctype="multipart/form-data">
    <div class="form-group">
      <font color="#a1a1a1"><span id="count"></span> characters remaining</font>
      <textarea type="text" name="bio" class="form-control emoji_act" id="bio" placeholder="10 - 140 characters" onkeyup="count_char(this, 140)"></textarea>
      <span id="bio_val"></span>
    </div>
    <div class="form-group">
      <button id="ok_but" class="btn btn-primary btn-block" type="submit" name="ed_submit">
    						Done
    					</button>
    </div>
  </form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.js"></script>


Solution

  • In order to learn how to use this js lib, please follow this document.

    now lets solve your current problem:

    you can set the property pickerPosition to bottom in your initial config which is passed to emojioneArea jquery function.

    $(document).ready(function() {
      $(".emoji_act").emojioneArea({
        emojiPlaceholder: ":smile_cat:",
        searchPlaceholder: "Search",
        buttonTitle: "Use your TAB key to insert emoji faster",
        searchPosition: "bottom",
        pickerPosition: "bottom"
      });
    });
    <link href="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.css" rel="stylesheet" />
    <div class="container-fluid pt-3">
      <form method="POST" action="" enctype="multipart/form-data">
        <div class="form-group">
          <font color="#a1a1a1"><span id="count"></span> characters remaining</font>
          <textarea type="text" name="bio" class="form-control emoji_act" id="bio" placeholder="10 - 140 characters" onkeyup="count_char(this, 140)"></textarea>
          <span id="bio_val"></span>
        </div>
        <div class="form-group">
          <button id="ok_but" class="btn btn-primary btn-block" type="submit" name="ed_submit">
        						Done
        					</button>
        </div>
      </form>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.js"></script>