From 49c9396fb132538ade52e3e0df964325eea01682 Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Thu, 21 Mar 2019 14:11:13 -0600 Subject: [PATCH] Fixes dragging on the minimap in trace timeline Signed-off-by: Ruben Vargas --- packages/jaeger-ui/src/components/TracePage/index.js | 5 ++++- packages/jaeger-ui/src/components/TracePage/index.test.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/components/TracePage/index.js b/packages/jaeger-ui/src/components/TracePage/index.js index 30446bc87d..7b1fd4cf37 100644 --- a/packages/jaeger-ui/src/components/TracePage/index.js +++ b/packages/jaeger-ui/src/components/TracePage/index.js @@ -254,7 +254,10 @@ export class TracePageImpl extends React.PureComponent { - this.setState((state: TracePageState) => ({ viewRange: { ...state.viewRange, ...update } })); + this.setState((state: TracePageState) => { + const time = { ...state.viewRange.time, ...update }; + return { viewRange: { ...state.viewRange, time } }; + }); }; toggleSlimView = () => { diff --git a/packages/jaeger-ui/src/components/TracePage/index.test.js b/packages/jaeger-ui/src/components/TracePage/index.test.js index 888befb811..42a36d132d 100644 --- a/packages/jaeger-ui/src/components/TracePage/index.test.js +++ b/packages/jaeger-ui/src/components/TracePage/index.test.js @@ -530,7 +530,7 @@ describe('', () => { updateNextViewRangeTime({ cursor }); wrapper.update(); refreshWrappers(); - viewRange.cursor = cursor; + viewRange.time.cursor = cursor; expect(spanGraph.prop('viewRange')).toEqual(viewRange); expect(timeline.prop('viewRange')).toEqual(viewRange); updateViewRangeTime(...current);