chore: removing tabindex from modal

This commit is contained in:
Hydra 2024-05-13 02:38:07 +01:00
parent ebcdf1af7a
commit aaa94a43bb
No known key found for this signature in database

View file

@ -24,7 +24,6 @@ export function Modal({
}: ModalProps) {
const [isClosing, setIsClosing] = useState(false);
const modalContentRef = useRef<HTMLDivElement | null>(null);
const titleRef = useRef<HTMLHeadingElement | null>(null);
const { t } = useTranslation("modal");
@ -53,8 +52,6 @@ export function Modal({
useEffect(() => {
if (visible) {
if (titleRef.current) titleRef.current.focus();
const onKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape" && isTopMostModal()) {
handleCloseClick();
@ -99,10 +96,8 @@ export function Modal({
>
<div className={styles.modalHeader}>
<div style={{ display: "flex", gap: 4, flexDirection: "column" }}>
<h3 ref={titleRef} tabIndex={0}>
{title}
</h3>
{description && <p tabIndex={0}>{description}</p>}
<h3>{title}</h3>
{description && <p>{description}</p>}
</div>
<button