Closed conrad closed 5 years ago
Thanks for the report, we'll look into it soon. We have some work in progress in #177 that is changing the API for mouse events a little bit, so we can definitely fix in that branch, and maybe also backport a fix (since that will be a breaking change)
In the meantime, you can work around this issue by using id: i + 1
. The problem is that id: 0
is reserved for the background ("nothing clicked"). After #177, this will change since ids will be generated by Worldview itself.
Ok. Great. That change to have an id prop that's non-zero fixed this :)
I'm trying to create mouse event handlers for specific objects, but these handlers are being triggered everywhere for the first object, specifically in a list of Cubes. The code looks like this:
Both the
onClick
andonMouseMove
handlers are triggered across the entire canvas with data for just the first cube passed to them. I tried adding thegetHitmapId
prop to help out, but it didn't make a difference.I was able to reproduce the issue on this page in the docs https://webviz.io/worldview/#/docs/commands/cubes by adding this onClick event on the 5th to last line:
<Cubes onClick={() => console.log('go')}>{markers}</Cubes>
.I'm on version 0.4.1. Any ideas?