Skip to content

Commit

Permalink
Revert "feat(react-kit): update Overlay feature with enableInitialFocus"
Browse files Browse the repository at this point in the history
This reverts commit fc773b8.
  • Loading branch information
psch300 committed Dec 12, 2024
1 parent fc773b8 commit b86aa8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/react-kit/src/core/Overlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type Props = {
size?: ResponsiveValue<OverlaySizeType>;
ignoreOutsideClickRefs?: RefObject<HTMLElement>[];
dismissFocusRef?: RefObject<HTMLElement>;
enableInitialFocus?: boolean;
} & MaxHeightProps &
SxProp &
HTMLAttributes<HTMLElement>;
Expand All @@ -36,7 +35,6 @@ const Overlay = (
size = 'm',
ignoreOutsideClickRefs = [],
dismissFocusRef,
enableInitialFocus = true,
maxHeight = forcePixelValue(600),
...props
}: PropsWithChildren<Props>,
Expand Down Expand Up @@ -80,7 +78,7 @@ const Overlay = (
);

useEffect(() => {
if (overlayRef.current && enableInitialFocus) {
if (overlayRef.current) {
const firstItem = iterateFocusableElements(overlayRef.current).next().value;
firstItem?.focus();
}
Expand Down

0 comments on commit b86aa8b

Please sign in to comment.