Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker committed Nov 22, 2024
1 parent e15d27a commit e7acc2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react/src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const Dialog = forwardRef<HTMLDivElement, DialogProps>(
): React.ReactPortal | null => {
const dialogRef = useSharedRef(dialogRefProp || ref);
const [headingId] = useId(1, 'dialog-title-');
const elementRef = useRef<HTMLDivElement>(null);
const headingRef = useRef<HTMLHeadingElement>(null);
const isolatorRef = useRef<AriaIsolate>();

Expand Down Expand Up @@ -83,9 +82,9 @@ const Dialog = forwardRef<HTMLDivElement, DialogProps>(
);

useEffect(() => {
if (!show || !elementRef.current) return;
if (!show || !dialogRef.current) return;

isolatorRef.current = new AriaIsolate(elementRef.current);
isolatorRef.current = new AriaIsolate(dialogRef.current);
setTimeout(focusHeading);

return () => {
Expand Down

0 comments on commit e7acc2c

Please sign in to comment.