Skip to content

Commit

Permalink
fix(react-components): click and double click events from toolbars pr…
Browse files Browse the repository at this point in the history
…opagate to the viewer (#4278)

* Initial commit

* Update reveal.api.md

* Update Cognite3DViewer.ts

* Update Cognite3DViewer.ts

* Update FlexibleCameraManager.ts

* Fixes according to review

* Fix code according to review

* Update withSuppressRevealEvents.tsx

* Update withSuppressRevealEvents.tsx
  • Loading branch information
nilscognite authored Feb 29, 2024
1 parent ceb7956 commit 1e508af
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ export function withSuppressRevealEvents<T extends object>(
return;
}

div.addEventListener('dblclick', stopPropagation);
div.addEventListener('pointerdown', stopPropagation);
div.addEventListener('wheel', stopPropagation);
div.addEventListener('keydown', stopPropagation);

return () => {
div.removeEventListener('dblclick', stopPropagation);
div.removeEventListener('pointerdown', stopPropagation);
div.removeEventListener('wheel', stopPropagation);
div.removeEventListener('keydown', stopPropagation);
Expand Down

0 comments on commit 1e508af

Please sign in to comment.