Closed Michael-Tajmajer-Bentley closed 3 years ago
Are you able to reproduce a minimal example in a code sandbox? (fork this and add @bentley/ui-core
as dependency).
Also can you provide some environment info? Package versions, OS version, browser version, etc (all of which are part of the issue template).
Where is the issue template located? I looked around for it, but can't seem to locate it :-( would you provide a link?
Package versions: "@itwin/itwinui-react": "1.1.0" "@bentley/ui-core": "2.14.1" "@bentley/ui-framework": "2.14.1" (all the @bentley packages are 2.14.1)
Browser/os: Chrome 90.0.4430.85 Windows 10 - 20H2
I've forked the example and have added ui-core and ui-framework to it. After that I get an error in the console:
https://codesandbox.io/s/itwinui-react-example-forked-0i9h3?file=/src/App.tsx:2112-2122
I added the ui-framework to allow me to use the ModelessDialogManager to open the dialog - which is where I am seeing the issue.
Any thoughts on how to proceed? I guess I could create an itwin-viewer-react example outside of the sandbox if that would be faster - thoughts?
Thanks for the info. For future reference, the issue template shows up when you create a new issue and choose "bug report" from https://github.com/iTwin/iTwinUI-react/issues/new/choose
That error looks very cryptic. My best guess is that it's missing some dependency or it needs additional TS configuration (e.g. CJS vs ESM)
Yeah, you could create an itwin-viewer sandbox if it would be easier. Ultimately, what we really need is to be able to reproduce the issue on our side to proceed with debugging.
Yup, as I suspected I pressed the wrong button :-) - thank you for pointing it out, I'll be sure to use it if I need to report anything in the future.
In that case, I'll see if I can get an itwin-viewer-react based example put together.
I created a simple-ish sample that demonstrates the issue: https://github.com/Michael-Tajmajer-Bentley/iTwinUI-react-select-issue
It needs a model & client id to run (see the .env file).
After several hours of debugging, here's what we've found:
The ui-core Dialog
has some css rules that conflict with the transform
calculations needed to position our Select menu.
In particular, the .core-dialog-hidden
class used here is causing problems because it forces the parent of the Select menu to have 0x0 dimensions. Ideally, the "no overlay" styling would be separate from the dialog functionality in a way that it does not need 0x0 elements. Is that something that's possible? @DanEastBentley @bsteinbk
As a workaround, #22 is adding popoverProps
to Select
. This would allow you to append the menu to a different DOM element outside the Dialog
, but you will need to set a higher z-index. Does that work for you? @Michael-Tajmajer-Bentley
This change will be fine for me - thanks @mayank99, your work is appreciated!
When do you think a new build would be ready? I'm not blocked by this, just curious.
Next release should happen in the next few days. Maybe later this week or early next week. I will update this thread when it happens.
Hello @Michael-Tajmajer-Bentley . Thank you for the finding! As @mayank99 mentioned, we have found a possibility how you could have it fixed. Just would be great, not to close the issue, before you actually get the fix :D It kinda conflicts our workflow.
I have submitted a PR to fix the modeless dialog issue in iModel.js: https://github.com/imodeljs/imodeljs/pull/1267
@Michael-Tajmajer-Bentley We just released v1.2.0 where you can use the workaround I mentioned above.
Dan,
Tried out the new build and things are fine now – thank you for your efforts in getting this resolved!
Regards,
Mike Tajmajer
From: Dan East @.> Sent: Thursday, April 22, 2021 2:51 PM To: iTwin/iTwinUI-react @.> Cc: Michael Tajmajer @.>; State change @.> Subject: Re: [iTwin/iTwinUI-react] Select does not position dropdown correctly (#17)
I have submitted a PR to fix the modeless dialog issue in iModel.js: imodeljs/imodeljs#1267https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_imodeljs_imodeljs_pull_1267&d=DwMCaQ&c=hmGTLOph1qd_VnCqj81HzEWkDaxmYdIWRBdoFggzhj8&r=xapKR-H6iuQdG5Hyp282n866XXXVxBX7Ds2SUQUuGJE&m=qIGNNncHm5BJvTs4lzUr1CRdX4sy9dHHPNpEM7G51AI&s=-FInZEZLvULylCDBfL3kkGUfzHiheq2JPLjmGrALBD4&e=
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_iTwin_iTwinUI-2Dreact_issues_17-23issuecomment-2D825139604&d=DwMCaQ&c=hmGTLOph1qd_VnCqj81HzEWkDaxmYdIWRBdoFggzhj8&r=xapKR-H6iuQdG5Hyp282n866XXXVxBX7Ds2SUQUuGJE&m=qIGNNncHm5BJvTs4lzUr1CRdX4sy9dHHPNpEM7G51AI&s=6nS0PI3jwd25Z7mkM8eh3BXIVNC0Lsm8Wg1UOaOFAng&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AN4R5UB7WL6GPY2PZFHUHC3TKB4YRANCNFSM43K6ETEA&d=DwMCaQ&c=hmGTLOph1qd_VnCqj81HzEWkDaxmYdIWRBdoFggzhj8&r=xapKR-H6iuQdG5Hyp282n866XXXVxBX7Ds2SUQUuGJE&m=qIGNNncHm5BJvTs4lzUr1CRdX4sy9dHHPNpEM7G51AI&s=P1Ki-vxu5eUnDYt17bq9tLj05Um6_nqKvr19-WP0y1w&e=.
I am trying to use the Select control inside of a modeless dialog. I have found that when I use the dropdown, the list is not positioned correctly.
I have attached a gif of this behavior.
I am using the Dialog from the @bentley/ui-core, and opening it via the ModelessDialogManager.openDialog().
This dialog is quite simple:
Any thoughts on how to correct this?