(#3) - templating

This commit is contained in:
Martin Slachta
2026-06-14 07:16:13 +02:00
parent 37bced77f4
commit 7b3d9f0ece
32 changed files with 870 additions and 126 deletions
+8
View File
@@ -179,6 +179,14 @@ export const RsvCalendarPicker = (() => {
new InputEvent('change', { bubbles: true, cancelable: true, composed: true })
);
},
// Re-check the radio for the current date. The date lives in JS state, so
// this restores the visual selection after a native form.reset() clears it.
reselect() {
if (this.date === null) return;
const radio = this.body.querySelector(`input[id="${this.date.toISOString()}"]`);
if (radio) radio.checked = true;
},
};
container.classList.add('rsv-calendar');