Skip to content

Commit

Permalink
fix Cant right click on polygon or rectangle filters to get the menu (#…
Browse files Browse the repository at this point in the history
…2066)

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta committed Jan 5, 2023
1 parent db54974 commit 0f7a424
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/src/map-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ export default function MapContainerFactory(
}}
onClick={(data, event) => {
// @ts-ignore
normalizeEvent(event.srcEvent, viewport);
const res = EditorLayerUtils.onClick(data, event, {
editorMenuActive,
editor,
Expand Down
7 changes: 4 additions & 3 deletions src/layers/src/editor-layer/editor-layer-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ export function onClick(
}
} else if (objectType === 'Polygon' || objectType === 'Point') {
let clickContext;
if (event.rightButton) {
if (event.rightButton && Array.isArray(event.srcEvent?.point)) {
const {point} = event.srcEvent;
clickContext = {
mapIndex,
rightClick: true,
position: {
x: event.changedPointers[0].offsetX,
y: event.changedPointers[0].offsetY
x: point[0],
y: point[1]
}
};
}
Expand Down

0 comments on commit 0f7a424

Please sign in to comment.