Table of Contents

Class MudMask

Namespace
MudBlazor
Assembly
MudBlazor.dll

A text input which conforms user input to a specific format while typing. Note that MudMask is recommended to be used in WASM projects only because it has known problems in BSS, especially with high network latency.

public class MudMask : MudBaseInput<string>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IAsyncDisposable
Inheritance
MudMask
Implements
Inherited Members
Extension Methods

Constructors

MudMask()

public MudMask()

Properties

AdornmentClassname

protected string AdornmentClassname { get; }

Property Value

string

ChildContent

The content within this input.

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

Property Value

RenderFragment

Remarks

Only displays when InputType is Hidden.

Classname

protected string Classname { get; }

Property Value

string

ClearButtonClassname

protected string ClearButtonClassname { get; }

Property Value

string

ClearIcon

The icon displayed when Clearable is true.

[Parameter]
[Category("Appearance")]
public string ClearIcon { get; set; }

Property Value

string

Clearable

Shows the clear button.

[Parameter]
[Category("List behavior")]
public bool Clearable { get; set; }

Property Value

bool

InputClassname

protected string InputClassname { get; }

Property Value

string

InputType

The type of the underlying input.

[Parameter]
[Category("List appearance")]
public InputType InputType { get; set; }

Property Value

InputType

Remarks

Defaults to Text.

Mask

The mask to apply to text values.

[Parameter]
[Category("Data")]
public IMask Mask { get; set; }

Property Value

IMask

Remarks

Typically set to common masks such as PatternMask, MultiMask, RegexMask, and BlockMask. When set, some properties will be ignored such as MaxLines, AutoGrow, and HideSpinButtons.

OnClearButtonClick

Occurs when the clear button is clicked.

[Parameter]
[Category("List appearance")]
public EventCallback<MouseEventArgs> OnClearButtonClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Clear()

Clears the text and value for this input.

public Task Clear()

Returns

Task

DisposeAsyncCore()

Called to dispose this instance.

protected override ValueTask DisposeAsyncCore()

Returns

ValueTask

FocusAsync()

Sets the cursor to this input.

public override ValueTask FocusAsync()

Returns

ValueTask

HandleKeyDown(KeyboardEventArgs)

protected Task HandleKeyDown(KeyboardEventArgs e)

Parameters

e KeyboardEventArgs

Returns

Task

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnBlurredAsync(FocusEventArgs)

protected override Task OnBlurredAsync(FocusEventArgs obj)

Parameters

obj FocusEventArgs

Returns

Task

OnInitializedAsync()

protected override Task OnInitializedAsync()

Returns

Task

OnSelect(int, int)

Occurs when the selected characters have changed.

public void OnSelect(int start, int end)

Parameters

start int

The index of the first selected character.

end int

The index of the last selected character.

SelectAsync()

Selects the text in this input.

public override ValueTask SelectAsync()

Returns

ValueTask

SelectRangeAsync(int, int)

Selects a range of characters in this input.

public override ValueTask SelectRangeAsync(int pos1, int pos2)

Parameters

pos1 int

The index of the first character to select.

pos2 int

The index of the last character to select.

Returns

ValueTask

UpdateTextPropertyAsync(bool)

Occurs when the value has changed internally.

protected override Task UpdateTextPropertyAsync(bool updateValue)

Parameters

updateValue bool

Returns

Task

Remarks

This method is called when the Text property needs to be refreshed from current Value.

UpdateValuePropertyAsync(bool)

Occurs when the value has changed internally.

protected override Task UpdateValuePropertyAsync(bool updateText)

Parameters

updateText bool

Returns

Task

Remarks

This method is called when the Value property needs to be refreshed from current Text.