UI and editing updates
This commit is contained in:
@@ -394,15 +394,24 @@
|
|||||||
} else if (field.type === 'email') {
|
} else if (field.type === 'email') {
|
||||||
inputType = 'email';
|
inputType = 'email';
|
||||||
} else if (field.type === 'url') {
|
} 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 `
|
return `
|
||||||
<label class="block text-sm font-medium">
|
<label class="block text-sm font-medium">
|
||||||
${escapeHtml(field.label)}
|
${escapeHtml(field.label)}
|
||||||
<input
|
<input
|
||||||
data-path="${escapeHtml(path)}"
|
data-path="${escapeHtml(path)}"
|
||||||
type="${inputType}"
|
type="${inputType}"
|
||||||
|
inputmode="${inputMode}"
|
||||||
|
placeholder="${escapeHtml(placeholder)}"
|
||||||
value="${escapeHtml(value)}"
|
value="${escapeHtml(value)}"
|
||||||
${field.min !== undefined ? `min="${escapeHtml(field.min)}"` : ''}
|
${field.min !== undefined ? `min="${escapeHtml(field.min)}"` : ''}
|
||||||
${field.max !== undefined ? `max="${escapeHtml(field.max)}"` : ''}
|
${field.max !== undefined ? `max="${escapeHtml(field.max)}"` : ''}
|
||||||
|
|||||||
Reference in New Issue
Block a user