iTwin/appui

Popups - dialogs appearing below the popped out widget

Closed this issue · 2 comments

Describe the bug

If a widget is popped out (on a single monitor), any dialog shown from that popped out widget will appear below the popout.

To Reproduce

No response

Expected Behavior

Should appear above the popped out widget.

Screenshots

image

Desktop (please complete the applicable information)

No response

Additional context

No response

I assume your widget uses UiFramework.dialogs.modal.open which is an old API therefore it is slightly problematic. By default it renders dialogs in the main window which is what is happening in your case. Unfortunately, there isn't anything we can do to fix this, however, you can fix this issue yourselves:

  • The best way to solve this would be to use Dialog from iTwinUI instead of the UiFramework.dialogs.modal.open function. This API was created before the iTwinUI dialogs existed so they are the new and preferred way to render dialogs.
  • If you do not want to use the iTwinUI Dialog, you can pass a parentDocument property when calling UiFramework.dialogs.modal.open e.g. you can create a ref for the button that opens the dialog and pass the ref.current.ownerDocument value as the third property in UiFramework.dialogs.modal.open.

Excellent, we will give these suggestions a try.