<div class="form-item ">
<label for="tags">
Stored at
</label>
<input type="text" id="tags" value="" class="tags-input">
</div>
{{> @form-item-input}}
{
"label": "Stored at",
"id": "tags",
"input-classes": "tags-input"
}
/**
* Initialize Choices for tags input
*/
/* global Choices */
'use strict';
(function () {
const tagsInputs = document.querySelectorAll('.tags-input');
// Stop if no element is present
if (!tagsInputs.length) return;
new Choices('.tags-input', {
removeItemButton: true,
shouldSort: false,
duplicateItemsAllowed: false,
items: [
{ value: 'shelf1' },
{ value: 'rack4' },
],
});
})();
Custom input with tagging functionality. Depends on the library Choices.js.