From 7ac7912156e7c3c8cda8e21d44a204c2040db1a6 Mon Sep 17 00:00:00 2001 From: Tanav Poswal Date: Thu, 3 Sep 2026 22:35:56 +0530 Subject: [PATCH] added a create collection modal button to add to collection modal --- client/modules/App/components/Overlay.tsx | 14 ++++++++++---- client/modules/IDE/actions/collections.js | 7 ++++--- .../IDE/components/AddToCollectionList.jsx | 19 ++++++++++++++++++- .../User/components/CollectionCreate.jsx | 3 ++- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/client/modules/App/components/Overlay.tsx b/client/modules/App/components/Overlay.tsx index a8bac53d3a..76cb2a56c9 100644 --- a/client/modules/App/components/Overlay.tsx +++ b/client/modules/App/components/Overlay.tsx @@ -15,6 +15,7 @@ type OverlayProps = { title?: string; ariaLabel?: string; isFixedHeight?: boolean; + isCompactHeight?: boolean; }; export const Overlay = ({ @@ -22,6 +23,7 @@ export const Overlay = ({ ariaLabel = 'modal', children, closeOverlay, + isCompactHeight = false, isFixedHeight = false, title = 'Modal' }: OverlayProps) => { @@ -43,8 +45,7 @@ export const Overlay = ({ if (!node) return; // Only close if it is the last (and therefore the topmost overlay) const overlays = document.getElementsByClassName('overlay'); - if (node.parentElement?.parentElement !== overlays[overlays.length - 1]) - return; + if (node.closest('.overlay') !== overlays[overlays.length - 1]) return; if (!closeOverlay) { browserHistory.push(previousPath); @@ -57,7 +58,9 @@ export const Overlay = ({ return (
{ + event.stopPropagation(); + close(); + }} aria-label={t('Overlay.AriaLabel', { title })} >