Skip to content

fix: Popover Positioning in FluentPopover#5244

Description

@elEs25

馃悰 Bug Report

The Popover appears to not respect the anchor's position and opens partially off-screen. This issue might be related to the AppMenu issues #5214 and #5215.

馃捇 Repro or Code Sample

@page "/popover"

<PageTitle>Popover</PageTitle>

<FluentTextInput Label="Popover-Width" @bind-Value=@popoverWidth Immediate />
<FluentStack Orientation="Orientation.Horizontal" HorizontalAlignment="HorizontalAlignment.SpaceBetween" Width="100%">
    <FluentButton id="left-button" OnClick="@(() => popoverPos="left")">Left</FluentButton>
    <FluentButton id="middle-button" OnClick="@(() => popoverPos = "middle")">Middle</FluentButton>
    <FluentButton id="right-button" OnClick="@(() => popoverPos = "right")">Right</FluentButton>
</FluentStack>

<FluentPopover AnchorId="@($"{popoverPos}-button")" 
    Width=@popoverWidth 
    @bind-Opened:get=@(popoverPos is not null) 
    @bind-Opened:set=@(opened => popoverPos = opened ? popoverPos : null)>
    Some Example-Text which does not matter.
</FluentPopover>

@code {
    private string? popoverPos = null;
    private string? popoverWidth = "300px";
}

馃 Expected Behavior

Popover is fully visible on screen, like it is when opening from anchor on middle of page:
Image

馃槸 Current Behavior

Opening the Popover on the right:

Image

Or the left:

Image

Leads to only partially visible Popover.

馃拋 Possible Solution

馃敠 Context

馃實 Your Environment

Clean Template Fluent Blazor WebAssembly-App

  • OS & Device: Windows on PC
  • Browser Microsoft Edge
  • .NET 10.0.8 and Fluent UI Blazor library Version 5.0.0-rc.5-26219.1

Activity

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

Metadata

Metadata

Labels

bugA bugv5For the next major version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions