From 5d7b4c195de6aa3a12e288d228e01710e429e26d Mon Sep 17 00:00:00 2001 From: Greg Solomon Date: Fri, 10 Nov 2023 10:29:44 -0500 Subject: [PATCH] Fix handling of className and testId in Panel with ModalSupport --- desktop/cmp/panel/Panel.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/desktop/cmp/panel/Panel.ts b/desktop/cmp/panel/Panel.ts index f4eeea9dba..932d0d8a6d 100644 --- a/desktop/cmp/panel/Panel.ts +++ b/desktop/cmp/panel/Panel.ts @@ -228,19 +228,21 @@ export const [Panel, panel] = hoistCmp.withFactory({ const useResizeContainer = resizable || collapsible || showSplitter; - // 5a) For modalSupport, className + testId need additional frame that will follow content + // For modalSupport, create additional frame that will follow content to portal and apply + // className and testId accordingly if (modalSupportModel) { item = modalSupport({ model: modalSupportModel, - item: frame({item, className, testId}) + item: frame({ + item, + className: model.isModal ? className : undefined, + testId: model.isModal ? testId : undefined + }) }); - - return useResizeContainer - ? resizeContainer({ref, item}) - : box({ref, item, ...layoutProps}); } - // 5b) No modalSupport, className + testId applied directly to parent + testId = model.isModal ? undefined : testId; // Only apply testId once + return useResizeContainer ? resizeContainer({ref, item, className, testId}) : box({ref, item, className, testId, ...layoutProps});