OGE logoOGE

Masked Text Box

A mask-first text box — the Kendo / Syncfusion MaskedTextBox, DevExtreme's mask option. Typing fills the slot at the caret and skips literals, Backspace and Delete empty a slot without shifting the rest, paste takes raw or formatted text, and IME composition is applied once it settles. Positions are logical, so the editor behaves the same in RTL.

The engine is @oge-ui/behavior's OgeMaskCore, and the same mask input works on <oge-text-box>. It binds through [(value)], [formField] or formControl like every other editor in the family.

shared mask engine IME-safe Signal Forms raw or formatted

Getting started

0 is a required digit; the parentheses, the space and the dash are literals the caret skips. The value is the raw digits — no literals, no placeholders — and a digit-only mask asks mobile keyboards for the numeric layout (inputmode="numeric").

mask raw value caret skips literals

Value:

Mask syntax and custom rules

0 digit, 9 optional digit, # digit/space/sign, L/l letter (required/optional, any script), A/a letter or digit, C/c any character; a backslash makes a rule character literal. maskRules adds single-character keys — a RegExp, a string of allowed characters or a predicate.

0 9 # L l A a C c maskRules escapes
#

Raw and formatted values

By default the value is the raw characters (DevExtreme's useMaskedValue: false, Kendo's raw value); includeLiterals commits the formatted text instead. maskCompleted fires once, when the last required slot is filled.

includeLiterals maskCompleted

raw: · formatted:

Type all 16 digits

Mask display

maskChar sets the placeholder of empty slots. showMaskMode: 'onFocus' keeps the empty mask hidden while blurred so the placeholder shows; a floating label does the same, so the label never sits on top of the mask.

maskChar showMaskMode floating label

Validation and forms

An unfinished mask flags the field (after blur, per errorDisplay) with maskInvalidMessage or the catalog's maskInvalidError. A reactive control gets a { mask } validator attached automatically; a Signal Forms schema checks the same rule with ogeMaskComplete(), which also runs on a server.

ogeMaskComplete formControl maskInvalidMessage

IBAN valid: false

Mask on the text box

The same engine on the plain text box: mask is optional there, so a time field can keep its clear button, prefix/suffix slots and counter-free chrome. Without a mask it is the ordinary text box.

oge-text-box mask input

Value: