@@ -73,20 +73,29 @@ export class MultiChartViewer extends PureComponent {
73
73
activeItemId = viewer . itemIdAry [ 0 ] ;
74
74
}
75
75
76
- const onChartSelect = ( chartId ) => {
76
+ const onChartSelect = ( ev , chartId ) => {
77
77
if ( chartId !== activeItemId ) {
78
78
dispatchUpdateCustom ( viewerId , { activeItemId : chartId } ) ;
79
79
}
80
+ stopPropagation ( ev ) ;
80
81
} ;
81
82
83
+
82
84
const makeItemViewer = ( chartId ) => (
83
- < div className = { chartId === activeItemId ? 'ChartPanel ChartPanel--active' : 'ChartPanel' } onClick = { ( ) => onChartSelect ( chartId ) } >
85
+ < div className = { chartId === activeItemId ? 'ChartPanel ChartPanel--active' : 'ChartPanel' }
86
+ onClick = { ( ev ) => onChartSelect ( ev , chartId ) }
87
+ onTouchStart = { stopPropagation }
88
+ onMouseDown = { stopPropagation } >
84
89
< ChartPanel key = { chartId } showToolbar = { false } chartId = { chartId } />
85
90
</ div >
86
91
) ;
87
92
88
93
const makeItemViewerFull = ( chartId ) => (
89
- < ChartPanel key = { chartId } showToolbar = { false } chartId = { chartId } />
94
+ < div onClick = { stopPropagation }
95
+ onTouchStart = { stopPropagation }
96
+ onMouseDown = { stopPropagation } >
97
+ < ChartPanel key = { chartId } showToolbar = { false } chartId = { chartId } />
98
+ </ div >
90
99
) ;
91
100
92
101
const newProps = {
@@ -115,6 +124,10 @@ export class MultiChartViewer extends PureComponent {
115
124
}
116
125
}
117
126
127
+
128
+ const stopPropagation = ( ev ) => ev . stopPropagation ( ) ;
129
+
130
+
118
131
MultiChartViewer . propTypes = {
119
132
viewerId : PropTypes . string . isRequired ,
120
133
canReceiveNewItems : PropTypes . string ,
0 commit comments