From 53ca23d520a9acfcf9a75df9af27bc5ee16f49d9 Mon Sep 17 00:00:00 2001 From: Kevin Aguiar Date: Sat, 18 Apr 2020 02:51:38 -0300 Subject: [PATCH] FIX: initialContent added --- docs/docs/changelog/index.md | 3 +++ docs/docs/twemoji-textarea-api/index.md | 5 +++-- package.json | 2 +- src/components/Sandbox.vue | 1 + src/components/TwemojiTextarea.vue | 6 +++--- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/docs/changelog/index.md b/docs/docs/changelog/index.md index bb8c7aeb..febeff43 100644 --- a/docs/docs/changelog/index.md +++ b/docs/docs/changelog/index.md @@ -4,6 +4,9 @@ title: 'Changelog' # Changelog +## 5.6.2 +- 'initialContent' prop added to TwemojiTextarea + ## 5.6.1 - Tweaks TwemojiPicker positioning diff --git a/docs/docs/twemoji-textarea-api/index.md b/docs/docs/twemoji-textarea-api/index.md index b9a09301..ffab9ed8 100644 --- a/docs/docs/twemoji-textarea-api/index.md +++ b/docs/docs/twemoji-textarea-api/index.md @@ -8,11 +8,12 @@ title: 'Twemoji Textarea API' - This component inherits all Twemoji Picker props **except disabled** which for clarity issues has a new name as seen below. You can check them [here](/docs/twemoji-picker-api#props). -### content +### initialContent +- Version: 5.6.2 onwards - Type: ``string`` - Default: ``''`` -This is the content variable which will be the output of the textarea with the emoji art img tags converted to its equivalent Unicode character. +This prop indicates the initial value of the textarea. ### enableSendBtn - Type: ``boolean`` diff --git a/package.json b/package.json index a0438319..9add137b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevinfaguiar/vue-twemoji-picker", - "version": "5.6.1", + "version": "5.6.2", "main": "dist/vue-twemoji-picker.umd.min.js", "module": "dist/vue-twemoji-picker.esm.min.js", "unpkg": "dist/vue-twemoji-picker.min.js", diff --git a/src/components/Sandbox.vue b/src/components/Sandbox.vue index d881aa45..f35758fa 100644 --- a/src/components/Sandbox.vue +++ b/src/components/Sandbox.vue @@ -49,6 +49,7 @@ :pickerArrowEnabled="false" idTextarea="idTextarea" pickerWidth="#idTextarea" + initialContent="TEST BUG CONTENT" > diff --git a/src/components/TwemojiTextarea.vue b/src/components/TwemojiTextarea.vue index 02c709ee..46f392cd 100644 --- a/src/components/TwemojiTextarea.vue +++ b/src/components/TwemojiTextarea.vue @@ -134,7 +134,7 @@ export default Vue.extend({ default: 'twemoji-textarea-outer', type: String as () => string, }, - content: { + initialContent: { default: '', type: String as () => string, }, @@ -205,8 +205,8 @@ export default Vue.extend({ // Init TwemojiPicker watchers TwemojiPropWatchers(this, this.twemojiPicker); - if (this.content.length === 0) { - this.twemojiTextarea.innerHTML = this.content; + if (this.initialContent.length > 0) { + this.twemojiTextarea.innerHTML = this.initialContent; } },