feat: allow selecting empty for custom selects

closes #13101
This commit is contained in:
Barış Soner Uşaklı
2025-01-30 10:22:45 -05:00
parent ef5ae00652
commit be62ae24ad
2 changed files with 6 additions and 2 deletions

View File

@@ -194,7 +194,11 @@ helpers.getCustomUserFields = async function (callerUID, userData) {
if (f.type === 'input-link' && userValue) {
f.linkValue = validator.escape(String(userValue.replace('http://', '').replace('https://', '')));
}
f['select-options'] = (f['select-options'] || '').split('\n').filter(Boolean).map(
f['select-options'] = (f['select-options'] || '').split('\n').filter(Boolean);
if (f.type === 'select') {
f['select-options'].unshift('');
}
f['select-options'] = f['select-options'].map(
opt => ({
value: opt,
selected: Array.isArray(userValue) ?