Skip to content

Commit

Permalink
fix(type): cast to GeometryValue on ElementClickListener
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Jun 7, 2021
1 parent 814da42 commit 3b34f9b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
TooltipValue,
niceTimeFormatter,
ElementClickListener,
GeometryValue,
RectAnnotation,
RectAnnotationDatum,
} from '@elastic/charts';
Expand Down Expand Up @@ -141,7 +142,8 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
const onClickPoint: ElementClickListener = useCallback(
([[geometryValue]]) => {
if (!Array.isArray(geometryValue)) {
const { x: timestamp } = geometryValue;
// casting to GeometryValue as we are using cartesian charts
const { x: timestamp } = geometryValue as GeometryValue;
jumpToTime(timestamp);
stopAutoReload();
}
Expand Down

0 comments on commit 3b34f9b

Please sign in to comment.