UI and editing updates

This commit is contained in:
Mark Gregory
2026-07-27 13:29:33 +01:00
parent d297948fb9
commit bdb5e7825d
@@ -394,15 +394,24 @@
} else if (field.type === 'email') {
inputType = 'email';
} else if (field.type === 'url') {
inputType = 'url';
// Internal CMS links may be relative paths, anchors, mail links,
// or complete external URLs. Browser type="url" rejects "/".
inputType = 'text';
}
const inputMode = field.type === 'url' ? 'url' : '';
const placeholder = field.type === 'url'
? '/, /blog, #section or https://example.com'
: '';
return `
<label class="block text-sm font-medium">
${escapeHtml(field.label)}
<input
data-path="${escapeHtml(path)}"
type="${inputType}"
inputmode="${inputMode}"
placeholder="${escapeHtml(placeholder)}"
value="${escapeHtml(value)}"
${field.min !== undefined ? `min="${escapeHtml(field.min)}"` : ''}
${field.max !== undefined ? `max="${escapeHtml(field.max)}"` : ''}