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
click button with text notify, you will see a warning snackbar message
click the button in the snackbar message with text Open Modal
will open the modal, but will close the modal imedially
exportconstWarning=forwardRef<HTMLDivElement,Props>(functionWarning({ id },ref){const{ closeSnackbar }=useSnackbar();const{ showModal }=useModal();consthandleUpgrade=useCallback((e: MouseEvent)=>{// !: why close snackbar will close modal?closeSnackbar(id);showModal(Modal);},[showModal,closeSnackbar,id]);return(<SnackbarContentref={ref}><Cardsx={{width: 400,height: 100,bgcolor: 'yellow'}}>warningmessage<br/><Buttonvariant="contained"onClick={handleUpgrade}sx={{textTransform: 'none',}}>OpenModal</Button></Card></SnackbarContent>
);});
Expected Behavior
If I open a modal by the button in snackbar:
Close snackbar should not affect the opened modal
default.mov
Current Behavior
Close snackbar will also close the modal.
Steps to Reproduce
Link: https://stackblitz.com/edit/github-nmphsn-91r7az?file=components%2FWarning.tsx
notify
, you will see a warning snackbar messageOpen Modal
Versions
The text was updated successfully, but these errors were encountered: