Skip to content

Commit

Permalink
V3 (#360)
Browse files Browse the repository at this point in the history
- do not add multiple   after the last tag, in mixed-mode (happens if initial input value has multiline)
- re-wrote "replaceTextWithNode" method completely and renamed it "replaceTextWithNode"
- fix bug where unintended mixed-mode prefixes are removed instead of only the one needed
- fix bug with mixed-mode dropdown not removed when Tagify de-focus
- Changes to "autoComplete" setting. added "rightKey" sub-setting
- when dropdown is shown, pressing ESC key should not create a new tag, but only hide the dropdown
- improve the auto-comeplete setting with sub-settings for "enter" & "right" keys functionality (issue #103)
- on fuzzy-search, only auto-complete the input with terms starts with the typed text
- added loader animations to the CSS and "loading" method to Tagify
- single-value select mode refactoring
- demo page - suggestion list as tags that when clicked add the clicked tag
- renamed jQuery event "remove" to "removeTag" #222
- make demo page header fixed to top
- all triggered events return the instance's scope (tagify)
- add methods to the README (replaceTag)
- improved CSS dropdown animations (on show)
- Show dropdown suggestions list on arrow down #333
- fixed #267 - Pasted text separated with new line symbol doesn't process correctly
- fixed #356 - addTags not working on mix-mode
- add boolean property to "this.dropdown" that would tell if the dropdown is shown or not
- show suggestions dropdown when editing a tag
- add event: "edit:keydown"
- new event: "edit:input"
- new event: "edit:change"
- new event: "edit:start"
- added dropdown ability to use css effects when showing
- dropdown auto-adjusts its placement if there's no space for it at the bottom, it will flip to be above
  • Loading branch information
yairEO committed Dec 12, 2019
1 parent c9480aa commit a31fc26
Show file tree
Hide file tree
Showing 16 changed files with 2,411 additions and 1,606 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ Temporary Items
/.vscode/launch.json
/.vscode/settings.json
/111.html
/logo.psd
179 changes: 123 additions & 56 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/jQuery.tagify.min.js

Large diffs are not rendered by default.

33 changes: 20 additions & 13 deletions dist/react.tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ class Tags extends React.Component {
}

shouldComponentUpdate(nextProps, nextState) {
const tagify = this.tagify

// check if value has changed
if (nextProps.value && nextProps.value.join() != this.props.value.join()) {
this.tagify.loadOriginalValues(nextProps.value);
if (nextProps.value && nextProps.value.join() !== this.props.value.join()) {
tagify.loadOriginalValues(nextProps.value)
// this.tagify.addTags(nextProps.value, true, true)
}

this.tagify.settings.whitelist = nextProps.settings.whitelist;
this.tagify.settings.whitelist = nextProps.settings.whitelist

if (nextProps.showDropdown)
this.tagify.dropdown.show.call(this.tagify, nextProps.showDropdown);
if (nextProps.showDropdown) {
tagify.dropdown.show.call(tagify, nextProps.showDropdown)
tagify.toggleFocusClass(true)
}
else if ("showDropdown" in nextProps && !nextProps.showDropdown) {
tagify.dropdown.hide.call(tagify)
}

// do not allow react to re-render since the component is modifying its own HTML
return false;
Expand All @@ -34,22 +41,22 @@ class Tags extends React.Component {

render() {
const attrs = {
ref: this._handleRef,
name: this.props.name,
className: this.props.className,
ref : this._handleRef,
name : this.props.name,
className : this.props.className,
placeholder: this.props.class,
autoFocus: this.props.autofocus,
value: this.props.children
};
autoFocus : this.props.autofocus,
value : this.props.children
}

const { className } = this.props;
const { className } = this.props

return React.createElement(
"div",
{ className },
React.createElement(
this.props.mode,
Object.assign({}, attrs, { defaultValue: this.props.initialValue })
Object.assign({}, attrs, { defaultValue:this.props.initialValue })
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/tagify.css

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

Loading

0 comments on commit a31fc26

Please sign in to comment.