

adds all whitelist items as tags and close the suggestion dropdown toggles class on the main tagify container

MyInput.insertAfterTag(HTMLElement (tag element), HTMLElement/String)

MyInput.injectAtCaret(HTMLElement (injectedNode), Object (range)) injects text or HTML node at last caret position. returns a tag element from the supplied tag data MyInput.tagLoading(HTMLElement, Boolean) same as above but for a specific tag element MyInput.replaceTag(tagElm, Object (tagData))
#Tagify js example update
if "tagData" exists, replace the tag element with new data and update Tagify value set/get tag data on a tag element (has.tagify_tag class by default) returns a specific tag DOM node by value returns a DOM nodes list of all the tags converts a String argument (] and ] are.) into HTML with mixed tags & texts returns how many tags already exists with that value returns the first matched tag node, if found returns the index of a specific tag, by value MyInput.getWhitelistItemsByValue(Object) returns an Array of found matching items (case-insensitive) MyInput.loadOriginalValues(String/Array) This method gets called automatically when instansiating Tagify. MyInput.removeTags(tags, silent, tranDuration) tranDuration: transition duration in ms silent: does not update the component's value Array/HTMLElement/String tag(s) to remove create an empty tag (optionally with pre-defined data) and enters "edit" mode directly Bypasses the normalization process in addTags, forcefully adding tags at the last caret location or at the end, if there's no last caret location saved MyInput.addTags(tags, clearInputAfterAdding, skipAddingInvalids) Position: 'null', // 'manual' - will not render the dropdown, and you would need to do it yourself 'text' - will place the dropdown next to the caret 'input' - will place the dropdown next to the input 'all' - normal, full-width design String - when tags have multiple properties, and for each tag another property should be used besides the "value"Įnabled: 2, // minimum input characters needs to be typed for the dropdown to show In mixed-mode this is ignored and treated as "true" RightKey: false // If true, when → is pressed, use the suggested value to create a tag, else just auto-completes the input. tries to autocomplete the input's value while typing disable manually typing/pasting/editing tags should ONLY use tags allowed in whitelist is this list has any items, then only allow tags from this list automatically converts pasted text into tags automatically adds the text which was inputed as a tag when blur event happens exposed callbacks object to be triggered on events: 'add' / 'remove' tags KeepInvalid: true, // keeps invalid edits as-is until esc is pressed while in focus Any other value is considered as double-click define conditions in which typed mix-tags content is allowing a tag to be created after.Ĭlicks: 2, // Number of clicks to enter "edit-mode": 1 for single click. everything between these will become a tag InsertAfterTag: '\u00A0', // node or string to add after a tag added the 'pattern' setting must be set to some character. use 'integrated' to skip the creation of the wrapper use 'mix' as value to allow mixed-content use 'select' for single-value dropdown-like select box split tags by any of these delimiters ("null" to cancel) tag data Object property which will be displayed as the tag's text
