UI and editing updates
This commit is contained in:
@@ -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)}"` : ''}
|
||||
|
||||
Reference in New Issue
Block a user