Skip to content

fix: FluentSelect with Multiple=true is always position: absolute #3379

@davhdavh

Description

@davhdavh

🐛 Bug Report

Adding a FluentSelect with Multiple=true always makes a component that uses the default .listbox, which has position: absolute.

💻 Repro or Code Sample

https://www.fluentui-blazor.net/#multipleitemswithsel remove the surrounding div (or remove the height)

🤔 Expected Behavior

It behaves like a block element

😯 Current Behavior

It's a popup on a 0 height element.

💁 Possible Solution

<FluentSelect Id="@Id" Autofocus="true" Items="Items" @bind-SelectedOptions="@SelectedEnums" OptionText="@NameFunc" Multiple="true" Placeholder="@Label" Height="300px" Immediate="true"/>
@InlineStyleValue
@code {
   private string Id = Identifier.NewId();

   private MarkupString InlineStyleValue => new InlineStyleBuilder()
                                           .AddStyle($"#{Id}::part(listbox)", "position", "relative").BuildMarkupString();
}

I personally think this is a bug, but if it was intended as such, please add a Parameter to let us set the position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions