Skip to content

Commit

Permalink
4.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Jul 20, 2022
1 parent d893323 commit 08205d2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
6 changes: 3 additions & 3 deletions dist/jQuery.tagify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react.tagify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions dist/tagify.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Tagify (v 4.13.3) - tags input component
* Tagify (v 4.14.0) - tags input component
* By Yair Even-Or
* https://github.com/yairEO/tagify
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -249,6 +249,8 @@ var DEFAULTS = {
// Exposed callbacks object to be triggered on certain events
addTagOnBlur: true,
// Flag - automatically adds the text which was inputed as a tag when blur event happens
onChangeAfterBlur: true,
// By default, the native way of inputs' onChange events is kept, and it only fires when the field is blured.
duplicates: false,
// "true" - allow duplicate tags
whitelist: [],
Expand Down Expand Up @@ -1294,7 +1296,7 @@ var events = {
}

this.postUpdate();
this.triggerChangeEvent();
_s.onChangeAfterBlur && this.triggerChangeEvent();
}

if (isTargetSelectOption || isTargetAddNewBtn) return;
Expand Down Expand Up @@ -1747,7 +1749,10 @@ var events = {
},

observeOriginalInputValue() {
// if original input value changed for some reason (for exmaple a form reset)
// if, for some reason, the Tagified element is no longer in the DOM,
// call the "destroy" method to kill all references to timeouts/intervals
if (!this.DOM.originalInput.parentNode) this.destroy(); // if original input value changed for some reason (for exmaple a form reset)

if (this.DOM.originalInput.value != this.DOM.originalInput.tagifyValue) this.loadOriginalValues();
},

Expand Down Expand Up @@ -2346,6 +2351,7 @@ Tagify.prototype = {
this.DOM.originalInput.tabIndex = this.DOM.originalInput_tabIndex;
this.dropdown.hide(true);
clearTimeout(this.dropdownHide__bindEventsTimeout);
clearInterval(this.listeners.main.originalInputValueObserverInterval);
},

/**
Expand Down Expand Up @@ -3555,7 +3561,7 @@ Tagify.prototype = {
var inputValue = this.getInputValue();
this.setOriginalInputValue(inputValue);
this.postUpdate();
if (!(args || {}).withoutChangeEvent && !this.state.blockChangeEvent) this.triggerChangeEvent();
if ((!this.settings.onChangeAfterBlur || !(args || {}).withoutChangeEvent) && !this.state.blockChangeEvent) this.triggerChangeEvent();
},

getInputValue() {
Expand Down
14 changes: 10 additions & 4 deletions dist/tagify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Tagify (v 4.13.3) - tags input component
* Tagify (v 4.14.0) - tags input component
* By Yair Even-Or
* https://github.com/yairEO/tagify
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -255,6 +255,8 @@
// Exposed callbacks object to be triggered on certain events
addTagOnBlur: true,
// Flag - automatically adds the text which was inputed as a tag when blur event happens
onChangeAfterBlur: true,
// By default, the native way of inputs' onChange events is kept, and it only fires when the field is blured.
duplicates: false,
// "true" - allow duplicate tags
whitelist: [],
Expand Down Expand Up @@ -1300,7 +1302,7 @@
}

this.postUpdate();
this.triggerChangeEvent();
_s.onChangeAfterBlur && this.triggerChangeEvent();
}

if (isTargetSelectOption || isTargetAddNewBtn) return;
Expand Down Expand Up @@ -1753,7 +1755,10 @@
},

observeOriginalInputValue() {
// if original input value changed for some reason (for exmaple a form reset)
// if, for some reason, the Tagified element is no longer in the DOM,
// call the "destroy" method to kill all references to timeouts/intervals
if (!this.DOM.originalInput.parentNode) this.destroy(); // if original input value changed for some reason (for exmaple a form reset)

if (this.DOM.originalInput.value != this.DOM.originalInput.tagifyValue) this.loadOriginalValues();
},

Expand Down Expand Up @@ -2352,6 +2357,7 @@
this.DOM.originalInput.tabIndex = this.DOM.originalInput_tabIndex;
this.dropdown.hide(true);
clearTimeout(this.dropdownHide__bindEventsTimeout);
clearInterval(this.listeners.main.originalInputValueObserverInterval);
},

/**
Expand Down Expand Up @@ -3561,7 +3567,7 @@
var inputValue = this.getInputValue();
this.setOriginalInputValue(inputValue);
this.postUpdate();
if (!(args || {}).withoutChangeEvent && !this.state.blockChangeEvent) this.triggerChangeEvent();
if ((!this.settings.onChangeAfterBlur || !(args || {}).withoutChangeEvent) && !this.state.blockChangeEvent) this.triggerChangeEvent();
},

getInputValue() {
Expand Down
4 changes: 2 additions & 2 deletions dist/tagify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tagify.polyfills.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Tagify (v 4.13.3) - tags input component
* Tagify (v 4.14.0) - tags input component
* By Yair Even-Or
* https://github.com/yairEO/tagify
* Permission is hereby granted, free of charge, to any person obtaining a copy
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": "@yaireo/tagify",
"version": "4.13.3",
"version": "4.14.0",
"homepage": "https://github.com/yairEO/tagify",
"description": "lightweight, efficient Tags input component in Vanilla JS / React / Angular [super customizable, tiny size & top performance]",
"keywords": [
Expand Down

0 comments on commit 08205d2

Please sign in to comment.