iTwin / appui

Monorepo for iTwin.js AppUi
MIT License
8 stars 2 forks source link

Changed models visibility gets overriden initialViewState on ViewportComponent mount #371

Closed GintV closed 10 months ago

GintV commented 1 year ago

Describe the bug

This is a regression comparing to iModel.js 2.19.x . We are using a viewportRef function property to get a reference to the ScreenViewport

image

After we do that, we adjust model visibility (add or remove models) by calling screenViewport.changeModelDisplay. After viewer is loaded, the adjustments we made are not present.

Looks like it happens because screenViewportRef.current?.changeView(initialViewState) is called one more time after line 279 was executed

image

Expected behavior After viewportRef function is called, view shouldn't be changed anymore on ViewportComponent mount.

Desktop (please complete the applicable information):

raplemie commented 1 year ago

Thanks, we'll look into this and get back to you if I need more information.

NancyMcCallB commented 1 year ago

This code was added to properly process the async method. It's not as simple as removing the additional call. I will look at this more next week.

GintV commented 1 year ago

@NancyMcCallB any update on this one?

raplemie commented 9 months ago

Hi @GintV, a fix for this was released today in AppUI 4.6.4. Let us know if it fixes your issue!

GintV commented 9 months ago

@raplemie Seems to be fixed on 4.6.4, thanks!