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
_firstBumper
protected ElementReference _firstBumper
Field Value
_lastBumper
protected ElementReference _lastBumper
Field Value
_root
protected ElementReference _root
Field Value
Properties
ChildContent
The content within this focus trap.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
DefaultFocus
The element which receives focus when this focus trap is created or enabled.
[Parameter]
[Category("Behavior")]
public DefaultFocus DefaultFocus { get; set; }
Property Value
Remarks
Defaults to FirstChild.
Disabled
Prevents the user from interacting with this focus trap.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
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
ShouldRender()
protected override bool ShouldRender()