Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
gap: 2rem;
align-items: center;
width: min-content;
padding: var(--space-32);
}

.navigation-login__logo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@
font-weight: var(--font-weight-bold);
line-height: var(--line-height-bold);
}

.service-accounts__nickname-input {
display: flex;
flex-direction: row;
gap: var(--gap-md);
align-items: center;
}

.service-accounts__nickname-input-max-length {
color: var(--color-text-tertiary);
font-size: var(--font-size-body-sm);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function AddServiceAccountForm(props: {
Enter the nickname of the service account you wish to add to the
team <span>{props.teamName}</span>
</div>
<div>
<div className="service-accounts__nickname-input">
<NewTextInput
onChange={(e) => {
updateFormFieldState({
Expand All @@ -334,7 +334,11 @@ function AddServiceAccountForm(props: {
});
}}
placeholder={"ExampleName"}
maxLength={32}
/>
<div className="service-accounts__nickname-input-max-length">
Max. 32 characters
</div>
</div>
</Modal.Body>
)}
Expand Down
9 changes: 9 additions & 0 deletions packages/cyberstorm/src/newComponents/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
isValidElement,
type PropsWithChildren,
type ReactNode,
useRef,
} from "react";
import "./Modal.css";
import { NewButton, NewIcon } from "../..";
Expand Down Expand Up @@ -191,6 +192,7 @@ export function Modal(props: ModalProps) {
} = props;

const filteredChildren: ReactNode[] = [];
const contentRef = useRef<HTMLDivElement | null>(null);

let exit = <Modal.Exit />;

Expand Down Expand Up @@ -251,6 +253,13 @@ export function Modal(props: ModalProps) {
props.contentClasses
)}
aria-describedby={ariaDescribedby}
onOpenAutoFocus={(e) => {
// Prevent auto-focusing the first focusable (usually Exit button with tooltip)
e.preventDefault();
contentRef.current?.focus();
}}
tabIndex={-1}
ref={contentRef}
>
{disableDefaultSubComponents ? (
children
Expand Down
Loading