Skip to content
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

EntityDescription is not rendered if second entity is clicked #628

Open
michfarmer opened this issue Sep 20, 2023 · 4 comments · May be fixed by #639
Open

EntityDescription is not rendered if second entity is clicked #628

michfarmer opened this issue Sep 20, 2023 · 4 comments · May be fixed by #639

Comments

@michfarmer
Copy link

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.

missingEntityDescription

@michfarmer
Copy link
Author

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.

@mfarmer-ara mfarmer-ara linked a pull request Oct 10, 2023 that will close this issue
@jakedarby24
Copy link

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

@Earthling7235
Copy link

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.

@mfarmer-ara
Copy link

mfarmer-ara commented Dec 12, 2023

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');
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants