Skip to content

fix: [Dropdowns' z-index is incorrect] in [FluentSelect, FluentAutocomplete] #3540

Closed

Description

@KavunCODE

🐛 Bug Report

When setting height for container where FluentComponent with dropdown is located -> dropdown is cut by this container. So FluentMenuProvider doesn't work as expected.

💻 Repro or Code Sample

@page "/fluent-dropdown-test"

<PageTitle>Fluent UI Dropdown Test</PageTitle>

<h3>FluentSelect Clipping Issue</h3>

<!-- Fixed Height Div -->
<div style="height: 100px; width: 100%; border: 2px solid red; margin-bottom: 20px; overflow: auto;">
	<FluentSelect Width="100%" TOption="string" Items="@ConnectionTypes"
				  @bind-SelectedOption="@SelectedConnectionType"
				  Label="Inside Fixed Height Div">
	</FluentSelect>
</div>

<!-- Flexible Height Div -->
<div style="width: 100%; border: 2px solid blue; margin-bottom: 20px;">
	<FluentSelect Width="100%" TOption="string" Items="@ConnectionTypes"
				  @bind-SelectedOption="@SelectedConnectionType"
				  Label="Inside Flexible Height Div">
	</FluentSelect>
</div>

<!-- Normal Use Case (Baseline) -->
<FluentSelect Width="100%" TOption="string" Items="@ConnectionTypes"
			  @bind-SelectedOption="@SelectedConnectionType"
			  Label="Baseline - Directly on Page">
</FluentSelect>

@code {
	private string SelectedConnectionType { get; set; }
	private List<string> ConnectionTypes = new() { "RDP - public", "VPN", "TV", "Remote Desktop" };
}

🤔 Expected Behavior

Same as any component that is located inside flexible div (meaning height is not set.)

😯 Current Behavior

issuexxx.mp4

💁 Possible Solution

Components that have "dropdown-list" should be flexible and have at least Property to set.
For ex.: RenderOrder="RenderOrder.Top/RenderOrder.InsideParent/..."

🔦 Context

We have tabs inside dialog. We want to have the same window size when switching tabs, the height of the content is different, so we decided to set static tabs' container height and bumped into that problem.
I know that we can set height for FluentSelect, but imagine FluentSelect should be at the bottom of form/container.

🌍 Your Environment

  • Win 11
  • Edge
  • .NET 8.0, FluentUI 4.11.6 (latest)

Activity

  1. added
    triage
    on Mar 19, 2025
  2. dvoituron commented on Mar 19, 2025

    @dvoituron
    Collaborator

    Sorry, I don't understand your question or problem. What is the relationship between FluentMenuProvider, FluentSelect and your example that talks about “Container” but has no code about it?

  3. KavunCODE commented on Mar 19, 2025

    @KavunCODE
    Author

    Sorry, I don't understand your question or problem. What is the relationship between FluentMenuProvider, FluentSelect and your example that talks about “Container” but has no code about it?

    1. FluentSelect, FluentAutocomplete, and potentially other Fluent UI Blazor components have the same issue, but I have specifically tested only these two.

    2. By "Container," I mean a div or a tabs container where tab content is placed. The issue is not limited to using FluentTabs—it can happen in any fixed-height div or container or whatever.

    3. From what I understand, in a past release, you introduced (or updated) FluentMenuProvider, which solved an issue where menu buttons inside a grid were being clipped inside the grid container.

    4. Previously, when clicking the last row's menu button, the dropdown was cut off by the grid's container, making some menu options inaccessible.

    1. This current issue with FluentSelect and FluentAutocomplete feels similar.
    2. Their dropdown content is not escaping their parent container (when placed inside a div with a fixed height).
      2.1) The expected behavior is for dropdowns to render outside of their parent container (as a popover/overlay).
      2.2) You may want to check whether FluentMenuProvider’s approach could be applied here to ensure dropdowns are not confined by their parent container.

    A similar issue was discussed in PR #2510:
    Fix FluentMenuProvider in DataGrid

    Similar problem now affects FluentSelect and FluentAutocomplete when placed inside containers with a fixed height.

    If anything is unclear, feel free to ask. Thanks!

  4. vnbaaij commented on Mar 19, 2025

    @vnbaaij
    Collaborator

    The issue with the MenuProvider is totally separate from this. We do not and can not control how or where the dropdown part of these components is rendered. That is done by the Fluent UI Web Components. We cannot make them 'escape' their parent container.

    The PR #2510 you link to does not mention anything about a DataGrid.

    I don't believe there is anything we can do with this report.

  5. KavunCODE commented on Mar 19, 2025

    @KavunCODE
    Author

    The issue with the MenuProvider is totally separate from this. We do not and can not control how or where the dropdown part of these components is rendered. That is done by the Fluent UI Web Components. We cannot make them 'escape' their parent container.

    The PR #2510 you link to does not mention anything about a DataGrid.

    I don't believe there is anything we can do with this report.

    Sorry for the misunderstanding. That PR addressed a similar issue where dropdowns were previously rendered inside their parent containers, which is why I referenced it.

    I tested FluentMenu in the exact same scenario as FluentSelect and FluentAutocomplete, and the issue does not occur. The menu dropdown is rendered correctly outside of its container, thanks to FluentMenuProvider.

    However, FluentSelect and FluentAutocomplete do render inside a fixed-height container. Since FluentMenuProvider successfully forces menus to render outside of their parent containers, wouldn’t a similar mechanism work for FluentSelect and FluentAutocomplete?

    Would you consider implementing something like FluentDropdownProvider to handle these components similarly to FluentMenu? If not, could you clarify:

    1. Why menus can be rendered outside of their containers while FluentSelect and Autocomplete cannot?
    2. Where should I report this issue at the Fluent UI Web Components level?
    3. If this is considered a limitation rather than a bug, could this be tracked as a feature request instead?

    I appreciate your guidance—thanks!

  6. changed the title [-]fix: [Dropdowns' z-index is incorrect] in [FluentMenuProvider][/-] [+]fix: [Dropdowns' z-index is incorrect] in [FluentSelect, FluentAutocomplete][/+] on Mar 19, 2025
  7. vnbaaij commented on Mar 19, 2025

    @vnbaaij
    Collaborator

    Sorry for the misunderstanding. That PR addressed a similar issue where dropdowns were previously clipped inside their parent containers, which is why I referenced it.

    I tested FluentMenu in the exact same scenario as FluentSelect and FluentAutocomplete, and the issue does not occur. The menu dropdown is rendered correctly outside of its container, thanks to FluentMenuProvider.

    As said, that is a different component so it is not related

    However, FluentSelect and FluentAutocomplete do render inside a fixed-height container. Since FluentMenuProvider successfully moves menus outside of their parent containers, wouldn’t a similar mechanism work for FluentSelect and FluentAutocomplete?

    Would you consider implementing something like FluentDropdownProvider to handle these components similarly to FluentMenu?

    We cant do that as the dropdowns are rendered by the web component and not by us

    if not, could you clarify:

    1. Why menus can be rendered outside of their containers while FluentSelect and Autocomplete cannot?

    See above. Different components

    1. Where should I report this issue at the Fluent UI Web Components level?

    In the Fluent UI repo. But it won't be fixed anymore as they are working on the next version of the web components

    1. If this is considered a limitation rather than a bug, could this be tracked as a feature request instead?>
      I appreciate your guidance—thanks!

    It will be addressed in the next version of the web components. See https://web-components.fluentui.dev/?path=/docs/components-dropdown--docs and change the height of the div containing the dropdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions