From a1da30bb5ab28d1f49fb55305d269cc2dcc0c708 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 10 Feb 2020 11:24:48 -0700 Subject: [PATCH] avoid opening up multiple tooltips in same location --- x-pack/legacy/plugins/maps/public/actions/map_actions.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/actions/map_actions.js b/x-pack/legacy/plugins/maps/public/actions/map_actions.js index 773dd6e1e1341..2c6c60db9a012 100644 --- a/x-pack/legacy/plugins/maps/public/actions/map_actions.js +++ b/x-pack/legacy/plugins/maps/public/actions/map_actions.js @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import _ from 'lodash'; import turf from 'turf'; import turfBooleanContains from '@turf/boolean-contains'; import uuid from 'uuid/v4'; @@ -428,8 +429,12 @@ export function closeOnClickTooltip(tooltipId) { export function openOnClickTooltip(tooltipState) { return (dispatch, getState) => { - const openTooltips = getOpenTooltips(getState()).filter(({ isLocked }) => { - return isLocked; + const openTooltips = getOpenTooltips(getState()).filter(({ features, location, isLocked }) => { + return ( + isLocked && + !_.isEqual(location, tooltipState.location) && + !_.isEqual(features, tooltipState.features) + ); }); openTooltips.push({