Skip to content

Commit 82ddfeb

Browse files
committed
fix: focus fixes
1 parent e6c6aa2 commit 82ddfeb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/containers/Tenant/Diagnostics/AccessRights/components/ChangeOwnerDialog.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function ChangeOwnerDialog({
7474
const [updateOwner, updateOwnerResponse] = schemaAclApi.useUpdateAccessMutation();
7575
const dialect = useAclSyntax();
7676

77+
const inputRef = React.useRef<HTMLInputElement>(null);
78+
7779
const handleTyping = (value: string) => {
7880
setNewOwner(value);
7981
setRequestErrorMessage('');
@@ -100,11 +102,18 @@ function ChangeOwnerDialog({
100102
});
101103
};
102104
return (
103-
<Dialog open={open} size="s" onClose={onClose} onEnterKeyDown={onApply}>
105+
<Dialog
106+
open={open}
107+
size="s"
108+
onClose={onClose}
109+
onEnterKeyDown={onApply}
110+
initialFocus={inputRef}
111+
>
104112
<Dialog.Header caption={i18n('action_change-owner')} />
105113
<Dialog.Body>
106114
<div className={block('dialog-content-wrapper')}>
107115
<TextInput
116+
controlRef={inputRef}
108117
id="queryName"
109118
placeholder={i18n('decription_enter-subject')}
110119
value={newOwner}

src/containers/Tenant/GrantAccess/components/SubjectInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export function SubjectInput({newSubjects, setNewSubjects}: SubjectInputProps) {
9999
onUpdate={setInputValue}
100100
ref={subjectInputRef}
101101
startContent={renderInline ? renderLabels() : undefined}
102+
autoFocus
102103
/>
103104
{!renderInline && renderLabels('wrap')}
104105
</Flex>

0 commit comments

Comments
 (0)