on Text Changed
Applies a text edit from the field.
Everything non-digit is stripped, so pasting (0712) 345-678 works. Input is capped at the region's maximum when enforceMaxLength is set, which stops a mistyped extra digit from silently invalidating an otherwise correct number.
Text that carries its own country — a typed or pasted +254…, or an autofill provider handing back a stored +254712345678 — adopts that country rather than being flattened into national digits for whichever country happened to be selected. Without this, an autofilled international number silently becomes a wrong national number: the + is stripped, the calling code is read as part of the subscriber number, and the field reports a plausible but incorrect value.