sadpandajoe commented on code in PR #43806:
URL: https://github.com/apache/superset/pull/43806#discussion_r3920818258
##########
superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx:
##########
@@ -233,6 +233,25 @@ const defaultResizableConfig = (hideFooter: boolean |
undefined) => ({
},
});
+/** Merge caller overrides without dropping default resize-handle guards. */
+export function mergeResizableConfig(
+ hideFooter: boolean | undefined,
+ overrides: ModalProps['resizableConfig'] = {},
+) {
+ const defaults = defaultResizableConfig(hideFooter);
+ if (!overrides || Object.keys(overrides).length === 0) {
+ return defaults;
+ }
+ return {
+ ...defaults,
+ ...overrides,
+ enable: {
+ ...defaults.enable,
+ ...overrides.enable,
Review Comment:
Passing `resizableConfig={{ enable: false }}` now enables the default
bottom/right handles because spreading `false` contributes no override. Should
this preserve the library's explicit opt-out and cover it with a regression
test?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]