Skip to content

Commit

Permalink
fixes #1050 - added the this instance scope as the second parameter…
Browse files Browse the repository at this point in the history
… to the `tag` template

react
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Jul 9, 2022
1 parent ee35bb3 commit 757e179
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/parts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default {
</tags>`
},

tag(tagData, tagify){
var _s = this.settings;
tag(tagData, {settings: _s}){
return `<tag title="${(tagData.title || tagData.value)}"
contenteditable='false'
spellcheck='false'
Expand Down
2 changes: 1 addition & 1 deletion src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ Tagify.prototype = {
// if( this.settings.readonly )
// tagData.readonly = true

tagElm = this.parseTemplate('tag', [templateData])
tagElm = this.parseTemplate('tag', [templateData, this])

// crucial for proper caret placement when deleting content. if textNodes are allowed as children of
// a tag element, a browser bug casues the caret to misplaced inside the tag element (especcially affects "readonly" tags)
Expand Down

0 comments on commit 757e179

Please sign in to comment.