Skip to content

Commit

Permalink
fix(dashboard): Chart menu disable is fixed on chart-fullscreen in is…
Browse files Browse the repository at this point in the history
…sue #25992 (#26410)
  • Loading branch information
sivasathyaseeelan authored Jan 4, 2024
1 parent 6f6c37e commit d0ffe9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 1 addition & 7 deletions superset-frontend/src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ interface ExtendedDropDownProps extends DropDownProps {
ref?: RefObject<HTMLDivElement>;
}

// @z-index-below-dashboard-header (100) - 1 = 99
export const NoAnimationDropdown = (
props: ExtendedDropDownProps & { children?: React.ReactNode },
) => (
<AntdDropdown
overlayStyle={{ zIndex: 99, animationDuration: '0s' }}
{...props}
/>
);
) => <AntdDropdown overlayStyle={props.overlayStyle} {...props} />;
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => {
? t('Exit fullscreen')
: t('Enter fullscreen');

// @z-index-below-dashboard-header (100) - 1 = 99 for !isFullSize and 101 for isFullSize
const dropdownOverlayStyle = {
zIndex: isFullSize ? 101 : 99,
animationDuration: '0s',
};

const menu = (
<Menu
onClick={handleMenuClick}
Expand Down Expand Up @@ -541,6 +547,7 @@ const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => {
)}
<NoAnimationDropdown
overlay={menu}
overlayStyle={dropdownOverlayStyle}
trigger={['click']}
placement="bottomRight"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ export default function HeaderReportDropDown({

const showReportSubMenu = report && setShowReportSubMenu && canAddReports();

// @z-index-below-dashboard-header (100) - 1 = 99
const dropdownOverlayStyle = {
zIndex: 99,
animationDuration: '0s',
};

useEffect(() => {
if (showReportSubMenu) {
setShowReportSubMenu(true);
Expand Down Expand Up @@ -288,6 +294,7 @@ export default function HeaderReportDropDown({
<>
<NoAnimationDropdown
overlay={menu()}
overlayStyle={dropdownOverlayStyle}
trigger={['click']}
getPopupContainer={(triggerNode: any) =>
triggerNode.closest('.action-button')
Expand Down

0 comments on commit d0ffe9a

Please sign in to comment.