feat: improve form usability with auto-focus, character limits, and unsaved changes warnings for better user experience
This commit is contained in:
@@ -937,8 +937,13 @@ function MonitorForm({
|
||||
value={formData.name}
|
||||
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
||||
placeholder="e.g. API, Website, CDN"
|
||||
autoFocus
|
||||
maxLength={255}
|
||||
className="w-full px-3 py-2 rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 text-neutral-900 dark:text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-brand-orange focus:border-transparent text-sm"
|
||||
/>
|
||||
{formData.name.length > 200 && (
|
||||
<span className={`text-xs tabular-nums mt-1 ${formData.name.length > 240 ? 'text-amber-500' : 'text-neutral-400'}`}>{formData.name.length}/255</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* URL with protocol dropdown + domain prefix */}
|
||||
|
||||
Reference in New Issue
Block a user