Skip to content

Commit

Permalink
fix: don't close modals on notification toast click (#13549)
Browse files Browse the repository at this point in the history
Co-authored-by: lmossman <lake@airbyte.io>
  • Loading branch information
Ella Rohm-Ensing and lmossman committed Aug 21, 2024
1 parent 77fa8c3 commit 546c4d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airbyte-webapp/src/components/ui/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Dialog, DialogPanel } from "@headlessui/react";
import classNames from "classnames";
import React, { useCallback, useEffect, useRef, useState } from "react";
import React, { useState, useCallback, useEffect, useRef } from "react";
import { useHotkeys } from "react-hotkeys-hook";
import { useIntl } from "react-intl";
import { useLocation } from "react-router-dom";

Expand Down Expand Up @@ -65,13 +66,18 @@ export const Modal: React.FC<React.PropsWithChildren<ModalProps>> = ({

const Wrapper = wrapIn || "div";

useHotkeys(["escape"], () => {
onModalCancel();
});

return (
<Dialog open={isOpen} onClose={onModalCancel} data-testid={testId} className={styles.modalPageContainer}>
<Dialog open={isOpen} onClose={() => null} data-testid={testId} className={styles.modalPageContainer}>
<Overlay />
<Wrapper
className={classNames(styles.modalContainer, {
[styles["modalContainer--noSidebarOffset"]]: size === "full",
})}
onClick={onModalCancel}
>
<DialogPanel className={styles.modalPanel}>
{cardless ? (
Expand Down

0 comments on commit 546c4d1

Please sign in to comment.