Skip to main content

FlyoutRestrictionMode Enum

Lists values that specify an element that restricts the Flyout position.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum FlyoutRestrictionMode

Members

Name Description
Viewport

The Flyout position is restricted by the viewport.

Page

The Flyout position is restricted by the page.

Rectangle

The Flyout position is restricted by a rectangle’s boundaries (RestrictionRectangle).

TargetElement

The Flyout position is restricted by a target element’s boundaries (RestrictionTarget).

Related API Members

The following properties accept/return FlyoutRestrictionMode values:

Remarks

Set the RestrictionMode property to one of the FlyoutRestrictionMode enumeration values to restrict the Flyout position.

Run Demo: Flyout - Automatic Position Adjustment

<DxButton CssClass="flipping-button" Click="() => IsOpen = !IsOpen">SHOW A FLYOUT</DxButton>
<DxFlyout @bind-IsOpen=IsOpen
    PositionTarget=".flipping-button"
    RestrictionTarget=".flipping-overflow-container"
    RestrictionMode="FlyoutRestrictionMode.TargetElement"
    CloseOnOutsideClick="false"
    PreventCloseOnPositionTargetClick="true"
    CloseMode="@CloseMode"
    FitToRestriction="@FitToRestriction"
    Width="240"
    >
    <span style="font-size: 0.75rem">@Constants.ContentShort</span>
</DxFlyout>

@code {
    IEnvironmentInfo EnvironmentInfo { get; set; }
    bool IsOpen { get; set; } = false;
    bool IsMobile { get; set; }
    bool FitToRestriction { get; set; } = true;
    FlyoutCloseMode[] CloseModes { get; } = Enum.GetValues<FlyoutCloseMode>();
    FlyoutCloseMode CloseMode { get; set; } = FlyoutCloseMode.Hide;
    protected override async Task OnAfterRenderAsync(bool firstRender) {
        if (firstRender) {
            await EnvironmentInfo.InitializeRuntime();
            var deviceInfo = await EnvironmentInfo.DeviceInfo;
            IsMobile = deviceInfo.IsMobileDevice;
        }
        await base.OnAfterRenderAsync(firstRender);
    }
}
See Also