Table of Contents

Class MudFocusTrap

Namespace
MudBlazor
Assembly
MudBlazor.dll

A component which prevents the keyboard focus from cycling out of its child content.

public class MudFocusTrap : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable
Inheritance
MudFocusTrap
Implements
Inherited Members
Extension Methods

Remarks

Typically used within dialogs and other overlays.

Constructors

MudFocusTrap()

public MudFocusTrap()

Fields

_fallback

protected ElementReference _fallback

Field Value

ElementReference

_firstBumper

protected ElementReference _firstBumper

Field Value

ElementReference

_lastBumper

protected ElementReference _lastBumper

Field Value

ElementReference

_root

protected ElementReference _root

Field Value

ElementReference

Properties

ChildContent

The content within this focus trap.

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

DefaultFocus

The element which receives focus when this focus trap is created or enabled.

[Parameter]
[Category("Behavior")]
public DefaultFocus DefaultFocus { get; set; }

Property Value

DefaultFocus

Remarks

Defaults to FirstChild.

Disabled

Prevents the user from interacting with this focus trap.

[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }

Property Value

bool

Remarks

Defaults to false.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

Releases resources used by this focus trap.

public void Dispose()

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

ShouldRender()

protected override bool ShouldRender()

Returns

bool