Skip to content

Commit

Permalink
feat(RelativeRangeDatePickerDialog): allow disable focus trap
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS committed Jan 27, 2025
1 parent e5c5940 commit 34b8309
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export interface PickerDialogProps {
isMobile?: boolean;
anchorRef?: React.RefObject<HTMLElement>;
onClose: () => void;
focusInput: () => void;
focusInput?: () => void;
disableFocusTrap?: boolean;
}

export function PickerDialog({
Expand All @@ -38,6 +39,7 @@ export function PickerDialog({
isMobile,
anchorRef,
className,
disableFocusTrap,
}: PickerDialogProps) {
if (isMobile) {
return (
Expand All @@ -56,14 +58,14 @@ export function PickerDialog({
open={open}
onEscapeKeyDown={() => {
onClose();
focusInput();
focusInput?.();
}}
onClose={onClose}
role="dialog"
anchorRef={anchorRef}
contentClassName={b('content', {size: props.size}, className)}
autoFocus
focusTrap
autoFocus={!disableFocusTrap}
focusTrap={!disableFocusTrap}
>
<DialogContent {...props} state={state} onApply={onClose} />
</Popup>
Expand Down

0 comments on commit 34b8309

Please sign in to comment.