iTwin / appui

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

Make model source links in PropertyGrid open to a new tab, rather than modifying the current window's href. #857

Closed hl662 closed 4 months ago

hl662 commented 4 months ago

Is your feature request related to a problem? Please describe.

image

After selecting an element that has a source path in the viewer, the property grid will show at the bottom a tab like above. If you click on the path, the link handler within propertyGrid tries to modify the current window's url. This will conflict with a behavior within the viewer where it will teardown the IModelApp when it detects a possible window redirect. This is done to avoid memory leaks when refreshing the window that has the viewer open.

Describe the Solution you'd like

I'd like it if clicking on the path results in a new tab being opened, rather than the window with the viewer within changing its href.

Describe alternatives you've considered

As documented in this PR, I tried using visibilitychange event, but that will cause the IModelApp shutdown to occur when you switch tabs. And the unload event is deprecated, so there is no long term viable alternatives...

Additional context

No response