Log a warning on an unknown input type

This commit is contained in:
Cohee
2025-04-30 22:58:43 +03:00
parent ef59afcec1
commit 63b48b9211

View File

@ -284,9 +284,7 @@ export class Popup {
} }
this.inputControls.appendChild(label); this.inputControls.appendChild(label);
} } else if (input.type === 'text') {
if (input.type === 'text') {
const label = document.createElement('label'); const label = document.createElement('label');
label.classList.add('text_label', 'justifyCenter'); label.classList.add('text_label', 'justifyCenter');
label.setAttribute('for', input.id); label.setAttribute('for', input.id);
@ -306,6 +304,9 @@ export class Popup {
label.appendChild(inputElement); label.appendChild(inputElement);
this.inputControls.appendChild(label); this.inputControls.appendChild(label);
} else {
console.warn('Unknown custom input type. Only checkbox and text are supported.', input);
return;
} }
}); });