You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const FirstModal = ({ closeFirstModal }) => {
const [openSecondModal] = useModal(() => <div>Second modal</div>);
return (
<div
onClick={() => {
openSecondModal();
// This closes the second modal as well but it should not
closeFirstModal();
}}
>
First modal
</div>
);
};
const Page = () => {
const [openFirstModal, closeFirstModal] = useModal(() => (
<FirstModal closeFirstModal={closeFirstModal} />
));
return <div onClick={openFirstModal}>Click me</div>;
};
In this situation, you click on the div Click me -> it displays First modal
Then when you click on the div First modal:
Expected behaviour: It should display Second modal and close FirstModal
What happens: It closes FirstModal and displays Second modal for a fraction of a second before closing it
The text was updated successfully, but these errors were encountered:
vicjune
changed the title
Modal inside modal: closing the first modal close the second
Modal inside modal: closing the first modal closes the second
Feb 9, 2022
In this situation, you click on the div
Click me
-> it displaysFirst modal
Then when you click on the div
First modal
:Expected behaviour: It should display
Second modal
and closeFirstModal
What happens: It closes
FirstModal
and displaysSecond modal
for a fraction of a second before closing itThe text was updated successfully, but these errors were encountered: