diff --git a/frontend/main.ts b/frontend/main.ts index 4cd5700..c578df6 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -171,6 +171,11 @@ interface ChoiceEvent extends Event{ } function initNewChoice(select: HTMLInputElement) { + + let seats = 0; + if (select.dataset && select.dataset.seats) { + seats = +select.dataset.seats; + } const choice = new Choices(select, { removeItemButton: true, loadingText: 'Wird geladen...', @@ -178,7 +183,7 @@ function initNewChoice(select: HTMLInputElement) { noChoicesText: 'Keine Ergebnisse gefunden', itemSelectText: 'Zum Auswählen klicken', placeholderValue: 'Ruderer auswählen', - maxItemCount: select.dataset.seats, + maxItemCount: seats, maxItemText: (maxItemCount) => { return `Nur ${maxItemCount} Ruderer können hinzugefügt werden`; },