Focusing on lone input when opening modals.

This commit is contained in:
Roland 2026-07-06 15:35:23 -06:00
parent 756c063d15
commit 4dfb997bfc
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 8 additions and 4 deletions

View file

@ -331,6 +331,7 @@ function EditTagsModal() {
<Form autoComplete='off'>
<Form.Input required
autoFocus
label={<b>Tag Name</b>}
placeholder='Unique name'
value={tagName}

View file

@ -84,7 +84,7 @@ export function AddToPlaylistModal({open, onClose, items = [], onComplete}) {
<Form onSubmit={handleCreateAndAdd} style={{marginTop: '1em'}}>
<Form.Field>
<label>Or create a new playlist</label>
<Input placeholder='New playlist name...' value={newName}
<Input autoFocus placeholder='New playlist name...' value={newName}
onChange={(e, {value}) => setNewName(value)}/>
</Form.Field>
</Form>

View file

@ -663,6 +663,7 @@ export function RenameModal({open, onClose, path, onSubmit, onPending}) {
<pre>{parent ? parent + '/' : null}{value}</pre>
<Input fluid
autoFocus
label='Name'
value={value}
onChange={handleInputChange}
@ -725,7 +726,7 @@ export function MoveModal({open, paths, onClose, onSubmit}) {
<Modal.Header>Move Files/Directories</Modal.Header>
<Modal.Content>
<p>Search for a directory to move your files into:</p>
<DirectorySearch onSelect={handleDirectory} disabled={pending}/>
<DirectorySearch onSelect={handleDirectory} disabled={pending} input={{autoFocus: true}}/>
<Table>
<TableHeader>
@ -829,6 +830,7 @@ export function MakeDirectoryModal({open, onClose, parent, onSubmit}) {
<Form onSubmit={handleSubmit}>
<pre>{mediaDirectory}/{parent}{value}</pre>
<Input fluid
autoFocus
label='Name'
value={value}
onChange={handleInputChange}

View file

@ -795,6 +795,7 @@ function MountModal({disk, open, onClose, onMount}) {
<Form.Field>
<label>Mount Point</label>
<Input
autoFocus
value={mountPoint}
onChange={(e) => setMountPoint(e.target.value)}
placeholder="/media/..."

View file

@ -38,7 +38,7 @@ function NewInventoryModal({open, onClose, onCreate}) {
return <Modal open={open} onClose={onClose} closeIcon>
<Modal.Header>New Inventory</Modal.Header>
<Modal.Content>
<Input fluid label='Name' value={name} onChange={e => setName(e.target.value)}
<Input fluid autoFocus label='Name' value={name} onChange={e => setName(e.target.value)}
placeholder='Food Storage' style={{marginBottom: '1em'}}/>
<div>
Type:{' '}
@ -231,7 +231,7 @@ export function InventoryRoute() {
<Modal open={renaming} onClose={() => setRenaming(false)} closeIcon size='tiny'>
<Modal.Header>Rename Inventory</Modal.Header>
<Modal.Content>
<Input fluid value={renameValue} onChange={e => setRenameValue(e.target.value)}/>
<Input fluid autoFocus value={renameValue} onChange={e => setRenameValue(e.target.value)}/>
</Modal.Content>
<Modal.Actions>
<Button onClick={() => setRenaming(false)}>Cancel</Button>