Closed michfarmer closed 2 months ago
I believe it has something to do with this line:
https://github.com/reearth/resium/blob/main/src/EntityDescription/EntityDescription.ts#L69
When you click on a second entity while the infobox is active, the classList no longer contains cesium-infoBox-bodyless
, which means it cannot find the node.
I've been noticing this problem as well, and it's preventing me from upgrading to 1.17.2 from 1.16.1. If this could be looked into it would be amazing
I'm getting this as well. We are dealing with it for now by flagging it as known behavior for now. Would love this to work as intended.
I spent a little time today figuring out a workaround to inject the class that it wants. It's not ideal but it seems to work for my purposes until the fix is accepted.
I put the following in the onSelectedEntityChange
parameter on <Viewer
. Change your ref as needed.
onSelectedEntityChange={(selectedEntity) => {
if (selectedEntity && !selectedEntity?.description) {
const container = refViewer?.current?.cesiumElement?.infoBox?.container;
const node = container.querySelector('.cesium-infoBox');
node.classList.add('cesium-infoBox-bodyless');
}
}
We noticed that if we click an Entity, and then immediately click another one, the EntityDescription is not rendered.
Looking at https://resium.reearth.io/examples/?path=/story/entity--description it seems that this example exhibits a similar behavior.
Clicking each entity in turn may or may not load the EntityDescription. Sometimes it does, sometimes it doesn't.