Skip to content

Commit

Permalink
Fix: [IGL-105] Made dismissOnEscape optional & removed contain From f…
Browse files Browse the repository at this point in the history
…ocusScrope (#613)
  • Loading branch information
vicky-comeau authored Dec 19, 2023
1 parent d8e91b5 commit 0dda883
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/cuddly-boats-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@igloo-ui/dialog": patch
"@igloo-ui/modal": patch
---

dismissOnEscape is now optional. 'contain' was removed from FocusScope inside Modal. This was causing errors in OV when dialog displayed above modal.
2 changes: 1 addition & 1 deletion packages/Dialog/src/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface DialogProps extends React.ComponentProps<"div"> {
/** Add a data-test tag for automated tests */
dataTest?: string;
/** Whether to close the dialog when the escape key is pressed */
dismissOnEscape: boolean;
dismissOnEscape?: boolean;
/** The text for the dismiss button */
dismissText?: string;
/** Whether the dialog is open or not */
Expand Down
4 changes: 2 additions & 2 deletions packages/Modal/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface ModalProps extends OverlayProps, AriaDialogProps {
/** Whether to close the modal when the escape key is pressed
* @default true
*/
dismissOnEscape: boolean;
dismissOnEscape?: boolean;
}

const Modal: React.FunctionComponent<ModalProps> = (props: ModalProps) => {
Expand Down Expand Up @@ -168,7 +168,7 @@ const Modal: React.FunctionComponent<ModalProps> = (props: ModalProps) => {
</AnimatePresence>
<AnimatePresence onExitComplete={onExitComplete}>
{isOpen && (
<FocusScope restoreFocus autoFocus contain>
<FocusScope restoreFocus autoFocus>
<m.div className="ids-modal__wrapper">
<m.div
key={`${keyValue}_modal`}
Expand Down

0 comments on commit 0dda883

Please sign in to comment.