Skip to content

Commit

Permalink
FIX: initialContent added
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfaveri committed Apr 18, 2020
1 parent 3bd34ab commit 53ca23d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docs/docs/changelog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ title: 'Changelog'

# Changelog

## 5.6.2
- 'initialContent' prop added to TwemojiTextarea

## 5.6.1
- Tweaks TwemojiPicker positioning

Expand Down
5 changes: 3 additions & 2 deletions docs/docs/twemoji-textarea-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/components/Sandbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
:pickerArrowEnabled="false"
idTextarea="idTextarea"
pickerWidth="#idTextarea"
initialContent="TEST BUG CONTENT"
>
</twemoji-textarea>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/TwemojiTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default Vue.extend({
default: 'twemoji-textarea-outer',
type: String as () => string,
},
content: {
initialContent: {
default: '',
type: String as () => string,
},
Expand Down Expand Up @@ -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;
}
},
Expand Down

0 comments on commit 53ca23d

Please sign in to comment.