Skip to content

Commit

Permalink
Fix handling of className and testId in Panel with ModalSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsolomon committed Nov 10, 2023
1 parent adc8922 commit 5d7b4c1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions desktop/cmp/panel/Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,21 @@ export const [Panel, panel] = hoistCmp.withFactory<PanelProps>({

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});
Expand Down

0 comments on commit 5d7b4c1

Please sign in to comment.