jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

TextArea height not getting set #25

Closed socialltd closed 7 years ago

socialltd commented 8 years ago

If we apply this to TextArea element the height of resultant DIV is not adjusted as per the TextArea rows. To achieve this I added the following line of code..

jquery.emojipicker.js

--look for this block --

if ($textarea.attr('maxlength')) {
      this.$editor.attr('maxlength', $textarea.attr('maxlength'));
    }

    var unicodeToImageText = this.emojiPopup.unicodeToImage($textarea.val());
        this.$editor.html(unicodeToImageText);
        this.$editor.attr({
            'data-id': id,
            'data-type': 'input',
            'placeholder': $textarea.attr('placeholder'),
            'contenteditable': 'true',
        });

--REPLACE with this block---


if ($textarea.attr('maxlength')) {
      this.$editor.attr('maxlength', $textarea.attr('maxlength'));
    }

        this.$editor.height($textarea.outerHeight()); //auto adjust height

    var unicodeToImageText = this.emojiPopup.unicodeToImage($textarea.val());
        this.$editor.html(unicodeToImageText);
        this.$editor.attr({
            'data-id': id,
            'data-type': 'input',
            'placeholder': $textarea.attr('placeholder'),
            'contenteditable': 'true',
        });
wokaole commented 7 years ago

it help me ,tks

vitormarcelino commented 7 years ago

Thanks!

TimBest commented 7 years ago

fixed in this commit https://github.com/OneSignal/emoji-picker/commit/5dc2afa59b741fa798f3d36a07b990521a1312e9