fix: World Map right-click value (#21209)

This commit is contained in:
Michael S. Molina 2022-08-26 15:08:24 -03:00 committed by GitHub
parent 0726840fb7
commit d41f44fcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,14 +108,13 @@ function WorldMap(element, props) {
const handleContextMenu = source => { const handleContextMenu = source => {
const pointerEvent = d3.event; const pointerEvent = d3.event;
pointerEvent.preventDefault(); pointerEvent.preventDefault();
const val = source.id || source.country; const val = mapData[source.id || source.country].name;
const formattedVal = mapData[val].name;
const filters = [ const filters = [
{ {
col: entity, col: entity,
op: '==', op: '==',
val, val,
formattedVal, formattedVal: val,
}, },
]; ];
onContextMenu(filters, pointerEvent.clientX, pointerEvent.clientY); onContextMenu(filters, pointerEvent.clientX, pointerEvent.clientY);