Skip to content

Commit 7018420

Browse files
committed
feat(RelativeRangeDatePickerDialog): allow disable focus trap
1 parent 5604758 commit 7018420

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/RelativeRangeDatePicker/components/PickerDialog/PickerDialog.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export interface PickerDialogProps {
2626
isMobile?: boolean;
2727
anchorRef?: React.RefObject<HTMLElement>;
2828
onClose: () => void;
29-
focusInput: () => void;
29+
focusInput?: () => void;
30+
disableFocusTrap?: boolean;
3031
}
3132

3233
export function PickerDialog({
@@ -38,6 +39,7 @@ export function PickerDialog({
3839
isMobile,
3940
anchorRef,
4041
className,
42+
disableFocusTrap,
4143
}: PickerDialogProps) {
4244
if (isMobile) {
4345
return (
@@ -56,14 +58,14 @@ export function PickerDialog({
5658
open={open}
5759
onEscapeKeyDown={() => {
5860
onClose();
59-
focusInput();
61+
focusInput?.();
6062
}}
6163
onClose={onClose}
6264
role="dialog"
6365
anchorRef={anchorRef}
6466
contentClassName={b('content', {size: props.size}, className)}
65-
autoFocus
66-
focusTrap
67+
autoFocus={!disableFocusTrap}
68+
focusTrap={!disableFocusTrap}
6769
>
6870
<DialogContent {...props} state={state} onApply={onClose} />
6971
</Popup>

0 commit comments

Comments
 (0)