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

Dropdowns (e.g., SelectContent portal) appear behind a control's parent window(s) by default #1377

Open
tombogle opened this issue Dec 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tombogle
Copy link
Contributor

Description
For example, in paratext-registration.web-view.tsx, TJ had to bump the z-index up to 250 to get over the floating web view z-index 200. I had to do the same for the Interface Language selector. This likely means that extension developers will also find themselves running up against this problem and wasting time trying to figure out the "right" solution. If we don't make it easy to get this to work correctly, we're likely to get bombarded by complaints, waste time, encounter potentially detrimental hacky solutions, and have harder to maintain code.

To Reproduce
To illustrate the problem, remove the style={{ zIndex: 250 }} hack from either paratext-registration.web-view.tsx or ui-language-selector.component.tsx

Expected behavior
All "dropdowns" (in a Select, a combo box, a multi-select combobox, etc.) should naturally and effortlessly appear on top of their surrounding content, regardless of whether they are in a tab, a dialog, a floating window, or in a circular gammaflexed black hole on the moon.

Notes
I tried modifying the shadcn SelectPrimitive.Content, changing tw-z-50 to tw-z-250. Interestingly, that fixed the problem in paratext-registration.web-view.tsx but not in ui-language-selector.component.tsx. In the case of the latter, the style showed as being applied in the DOM, but the z-index showed as auto. Not sure why. If something like this could be made to work, it might be the solution, but we'd need to see if similar tweaks were needed in other controls that use portals with a z-index of 50 (e.g., DropdownMenuPrimitive.Portal, PopoverPrimitive.Portal).

@tombogle tombogle added the bug Something isn't working label Dec 10, 2024
@jolierabideau
Copy link
Contributor

I also had this problem with our ComboBox that uses Popover underneath.

@tjcouch-sil tjcouch-sil changed the title Without "heroics" dropdowns (e.g., SelectContent portal) can appear behind a control's parent window(s) Dropdowns (e.g., SelectContent portal) appear behind a control's parent window(s) by default Dec 10, 2024
@tombogle
Copy link
Contributor Author

The preview app example code for the UI Language Selector will nicely illustrate the problem, so all you have to do to see it is comment out the little hack in src\components\advanced\ui-language-selector.component.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants