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