The native <input> element to enhance.
Configuration options for the widget.
Read-only property indicating whether the suggestion dropdown is currently visible.
Read-only property indicating whether the maximum tag count
has been reached (when maxTags is configured).
Read-only property returning the current tag array (defensive copy).
Equivalent to getTags().
Adds a single tag by value.
Resolves the display label from loaded suggestions (matching on
value), falling back to label === value if no match exists.
The tag value to add.
true if the tag was added; false if rejected
(duplicate or max reached).
Fires taga11y:add and taga11y:change on success.
Fires no events on rejection (shows error chip + region instead).
Batch-adds multiple tags. Duplicates are skipped silently.
Fires taga11y:add per successfully added tag and a single
taga11y:change after all additions with the final tag set.
Suggestion items to add.
Blurs the combobox input element.
Removes all tags at once.
Fires taga11y:clear (detail: { tags: TagData[] }) and
taga11y:change (detail: { tags: [] }).
Closes the suggestion dropdown. No-op if already closed.
Tears down the widget: removes the injected DOM, detaches all event listeners, restores the original input's attributes, and moves it back to its original DOM position.
Fires a taga11y:destroy event on the original input.
Dispatches a custom event on the original input element.
All events bubble and are not cancelable.
Event name.
Event detail payload.
Focuses the combobox input element.
Returns a defensive copy of the current tag array.
Array of TagData objects representing selected tags.
Initialises the widget: builds the DOM structure, wires up managers, pre-populates tags from the original input value, and sets up form reset handling.
Called automatically by the constructor. Invoke again after destroy to re-initialise.
Checks whether a tag with the given value is currently selected.
The tag value to check.
true if a tag with the matching value exists.
Removes a previously registered event listener.
Event name.
The handler to remove.
Registers a listener for a taga11y custom event on the original input element.
Event name. One of "taga11y:add",
"taga11y:remove", "taga11y:clear", "taga11y:change",
"taga11y:paste", or "taga11y:destroy". See the class
docblock for detail payload shapes.
Event listener callback.
Opens the suggestion dropdown. No-op if already open or disabled.
Removes a single tag by value.
The tag value to remove.
The removed TagData, or null if no tag with that
value exists.
Fires taga11y:remove and taga11y:change. Returns focus to
the combobox input after removal.
Fully replaces all tags with the given items.
Fires taga11y:clear with the previously selected tags, then
taga11y:add per newly added tag, and finally a single
taga11y:change with the final tag set.
Suggestion items to set as the new tag set.
Updates one or more runtime options after initialisation.
Only the provided keys are applied; unprovided keys retain their current values. Each option triggers specific side effects:
disabled — enables/disables the input, hidden input, and chip
remove buttons; toggles .taga11y--disabled class.theme — sets or removes data-theme on the wrapper.maxTags — updates the selection manager's limit.delimiter — updates delimiter characters.enforceSuggestions — toggles whitelist mode.label — creates, updates, or removes the visible label element.suggestions — replaces the suggestion source.debounceMs — updates the debounce delay for dynamic mode.serialize — updates the hidden input serializer.deserialize — updates the initial-value parser; takes effect on the
next form reset (does not retroactively re-parse current tags).name — updates the hidden input's name attribute.Partial options object with keys to update.
Creates a new taga11y instance and immediately initialises it.