File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed
Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -182,16 +182,23 @@ const ChartDrillContextMenu: FC<{ chartConfig?: ChartConfig }> = memo(
182182 availableSourceFunctions ,
183183 ] ) ;
184184
185+ const hasContextMenu =
186+ drillOption ?. isDrillable || runtimeDateLevelFields ?. length ;
187+
185188 return (
186189 < StyledChartDrill className = "chart-drill-menu-container" >
187- < Dropdown
188- disabled = { ! drillOption }
189- overlay = { contextMenu }
190- destroyPopupOnHide = { true }
191- trigger = { [ 'contextMenu' ] }
192- >
190+ { hasContextMenu ? (
191+ < Dropdown
192+ disabled = { ! drillOption }
193+ overlay = { contextMenu }
194+ destroyPopupOnHide = { true }
195+ trigger = { [ 'contextMenu' ] }
196+ >
197+ < div style = { { height : '100%' } } > { children } </ div >
198+ </ Dropdown >
199+ ) : (
193200 < div style = { { height : '100%' } } > { children } </ div >
194- </ Dropdown >
201+ ) }
195202 </ StyledChartDrill >
196203 ) ;
197204 } ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ export class ChartDrillOption implements IChartDrillOption {
6363 return this . cursor + 2 === this . drillFields . length ;
6464 }
6565
66+ public get isDrillable ( ) {
67+ return this . drillFields . length > 1 ;
68+ }
69+
6670 public get canSelect ( ) {
6771 return isEmptyArray ( this . expandDownFields ) ;
6872 }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export interface IChartDrillOption {
2222 mode : DrillMode ;
2323 isSelectedDrill : boolean ;
2424 isBottomLevel : boolean ;
25+ isDrillable : boolean ;
2526 canSelect : boolean ;
2627 toggleSelectedDrill ( enable ?: boolean ) : void ;
2728 getAllFields ( ) : ChartDataSectionField [ ] ;
You can’t perform that action at this time.
0 commit comments