ISSUE-833 Autofocus better when working with calendars (#834)

This commit is contained in:
Benoit TELLIER
2026-04-27 10:26:15 +02:00
committed by GitHub
parent 6b086658eb
commit dffb305886
4 changed files with 7 additions and 3 deletions
@@ -366,6 +366,7 @@ function CalendarPopover({
visibility={visibility}
setVisibility={setVisibility}
calendar={calendar}
autoFocusName={!calendar}
/>
)}
{tab === 'access' && calendar && (
@@ -263,7 +263,7 @@ export default function CalendarResources({
<ResourceSearch
objectTypes={['resource']}
selectedResources={selectedResources}
inputSlot={params => <TextField {...params} size="small" />}
inputSlot={params => <TextField {...params} size="small" autoFocus />}
onChange={async (_event: React.SyntheticEvent, value: Resource[]) => {
const requestSeq = ++fetchSeqRef.current
setSelectedResources(value)
+1 -1
View File
@@ -283,7 +283,7 @@ export default function CalendarSearch({
<PeopleSearch
objectTypes={['user']}
selectedUsers={selectedUsers}
inputSlot={params => <TextField {...params} size="small" />}
inputSlot={params => <TextField {...params} size="small" autoFocus />}
onChange={async (_event: React.SyntheticEvent, value: User[]) => {
setSelectedUsers(value)
+4 -1
View File
@@ -28,7 +28,8 @@ export function SettingsTab({
setColor,
visibility,
setVisibility,
calendar
calendar,
autoFocusName
}: {
name: string
setName: (name: string) => void
@@ -39,6 +40,7 @@ export function SettingsTab({
visibility: 'public' | 'private'
setVisibility: (visibility: 'public' | 'private') => void
calendar?: Calendar
autoFocusName?: boolean
}) {
const { t } = useI18n()
const [toggleDesc, setToggleDesc] = useState(Boolean(description))
@@ -93,6 +95,7 @@ export function SettingsTab({
<TextField
fullWidth
label=""
autoFocus={autoFocusName}
inputProps={{ 'aria-label': t('common.name') }}
placeholder={t('common.name')}
value={name}