Skip to content

Commit 04e642e

Browse files
committed
DM-11477: fixed: highlighting charts stopped working, this is
related to controlling event propagation when in the the slate view.
1 parent c4ad483 commit 04e642e

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/firefly/js/charts/ui/MultiChartViewer.jsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,29 @@ export class MultiChartViewer extends PureComponent {
7373
activeItemId = viewer.itemIdAry[0];
7474
}
7575

76-
const onChartSelect = (chartId) => {
76+
const onChartSelect = (ev,chartId) => {
7777
if (chartId !== activeItemId) {
7878
dispatchUpdateCustom(viewerId, {activeItemId: chartId});
7979
}
80+
stopPropagation(ev);
8081
};
8182

83+
8284
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}>
8489
<ChartPanel key={chartId} showToolbar={false} chartId={chartId}/>
8590
</div>
8691
);
8792

8893
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>
9099
);
91100

92101
const newProps = {
@@ -115,6 +124,10 @@ export class MultiChartViewer extends PureComponent {
115124
}
116125
}
117126

127+
128+
const stopPropagation= (ev) => ev.stopPropagation();
129+
130+
118131
MultiChartViewer.propTypes= {
119132
viewerId : PropTypes.string.isRequired,
120133
canReceiveNewItems : PropTypes.string,

src/firefly/js/charts/ui/PlotlyWrapper.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,14 @@ isDebug() && console.log(`${renderType.toString()} ${dataUpdateTraces} elapsed:
341341
// chart image download relies on div id matching chartId
342342
const nstyle = Object.assign({position:'relative', height: '100%', width: '100%'}, style);
343343
return (
344-
<div style={nstyle}
345-
onClick={stopPropagation}
346-
onTouchStart={stopPropagation}
347-
onMouseDown={stopPropagation} >
344+
<div style={nstyle} >
348345
<div id={chartId || this.id} style={{height: '100%', width: '100%'}} ref={this.refUpdate}/>
349346
{showMask && <div style={maskWrapper}> <div className='loading-mask'/> </div>}
350347
</div>
351348
);
352349
}
353350
}
354351

355-
356-
const stopPropagation= (ev) => ev.stopPropagation();
357-
358352
PlotlyWrapper.propTypes = {
359353
chartId: PropTypes.string,
360354
data: PropTypes.arrayOf(PropTypes.object),

0 commit comments

Comments
 (0)