Problem using Tagify on boilerplate
Hi all, I'm trying to use Tagify on boilerplate. I created a field in an item to add tags. I'm trying to add the call on the onRender of the item-sheet.js but the chips are not working. Does anyone had this kind of challenge before?
1 Reply
I already solved it! The solution was to add the render hook in the main.mjs file. For example:
Hooks.on("renderPanRpgItemSheet", (app, html, data) => {
if (app.document.type === "armor") {
const tagInput = html.querySelector("#tag-input");
if (tagInput && !tagInput.dataset.tagifyInitialized) {
new Tagify(tagInput, {
whitelist: ["armor", "shield", "light", "medium", "heavy"],
dropdown: {
maxItems: 10,
enabled: 0,
closeOnSelect: false
}
});
tagInput.dataset.tagifyInitialized = "true";
}
}
});
I'm sharing the solution in case anyone else encounters the same issue.