Skip to content

Commit

Permalink
Fix: Also do not close the sidebar when clicking on other Dynamic modals
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubcolony committed Jan 22, 2025
1 parent adcc201 commit 4e118b5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/context/ActionSidebarContext/ActionSidebarContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ const ActionSidebarContextProvider: FC<PropsWithChildren> = ({ children }) => {
const isClickedInside = isElementInsideModalOrPortal(element);
const navigationWrapper = getElementWithSelector('.modal-blur-navigation');
const dynamicWalletModal = getElementWithSelector('#dynamic-modal');
const dynamicSendTransactionModal = getElementWithSelector(
'#dynamic-send-transaction',
);
const dynamicSignMessageModal = getElementWithSelector(
'#dynamic-sign-message',
);

if (
!isClickedInside ||
(isChildOf(navigationWrapper, element) && !isTablet) ||
// Do not close the sidebar when clicking within the Dynamic wallet library modal
isChildOf(dynamicWalletModal, element)
// Do not close the sidebar when clicking within the Dynamic wallet library modals
isChildOf(dynamicWalletModal, element) ||
isChildOf(dynamicSendTransactionModal, element) ||
isChildOf(dynamicSignMessageModal, element)
) {
return false;
}
Expand Down

0 comments on commit 4e118b5

Please sign in to comment.