New fixes around sheets

This commit is contained in:
2026-06-06 17:56:50 +02:00
parent 2143bcc8db
commit 2691ff521f
16 changed files with 52 additions and 56 deletions
@@ -67,7 +67,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
// ── Soumission du formulaire ────────────────────────────────────────
/** @override - coerce string values from HTML form inputs to numbers */
_prepareSubmitData(submitData, form, formData) {
_prepareSubmitData(event, form, formData, updateData) {
const fd = foundry.utils.deepClone(formData.object)
for (const [key, value] of Object.entries(fd)) {
@@ -131,6 +131,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
// ── Actions ─────────────────────────────────────────────────────────
_onRender(context, options) {
super._onRender(context, options)
// Activate initial tabs (force to bypass changeTab's early-return when the
// tab is already set as active in tabGroups — Foundry v12 doesn't call
// changeTab on initial render, so the active class is never applied)
@@ -151,7 +152,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
}
/** @override */
async _onDropItem(item) {
async _onDropItem(event, item) {
const doc = item instanceof foundry.abstract.Document ? item : await fromUuid(item.uuid)
if (!doc) return
const itemData = doc.toObject()
@@ -78,6 +78,13 @@ export class VermineBaseItemSheet extends HandlebarsApplicationMixin(foundry.app
this.#dragDrop.forEach(d => d.bind(this.element))
}
// ── Sauvegarde ───────────────────────────────────────────────────────
/** @override */
_prepareSubmitData(event, form, formData, updateData) {
return super._prepareSubmitData(event, form, formData, updateData)
}
// ── Actions ─────────────────────────────────────────────────────────
static #onToggleSheet() {