-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(react-components): use "any intersection" in useClickedNode #4538
fix(react-components): use "any intersection" in useClickedNode #4538
Conversation
@@ -55,13 +54,17 @@ export const useClickedNodeData = (): ClickedNodeData | undefined => { | |||
if (event.button !== MOUSE.LEFT) { | |||
return; | |||
} | |||
const intersection = await viewer.getIntersectionFromPixel(event.offsetX, event.offsetY); | |||
|
|||
const intersection = await viewer.getAnyIntersectionFromPixel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only interesting line 😅 The rest is just refactoring
? intersection.assetRef?.externalId ?? intersection.assetRef?.id | ||
: undefined | ||
).data; | ||
const nodeDataPromises = useFdm3dNodeDataPromises(intersection).data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a bit more clean to have it as below? for other two Mapping as well
const { data: nodeDataPromises } = useFdm3dNodeDataPromises(intersection);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
One minor comment
Type of change
Jira ticket 📘
https://cognitedata.atlassian.net/browse/
Description 📝
This makes clicking interact properly with the new measurements in the react-components.
How has this been tested? 🔍
Test instructions ℹ️
Checklist ☑️