Plugins are functions that are called with input/textarea element and mask options as arguments upon mask initialization. They can optionally return cleanup logic and allow you to extend mask with arbitrary additional behavior.
maskitoRejectEvent
in @maskito/kit
maskitoTransform
or just add maskitoInitialCalibrationPlugin
to mask options. By default, Maskito does not break IME Composition and waits until compositionend
fires to begin calibration of the textfield's value. It is especially important for East Asian languages such as Chinese, Japanese, Korean, and other languages with complex characters.
However, sometimes this behaviour is not desired and you can want to enable mask validation on every keystroke (to be like a classic not-composition input). For example, some Android devices with enabled system autocomplete can interpret user's input as part of composition event – waiting for compositionend
can be not required for some cases (e.g. entering of numbers or your application is not used by East Asian clients). For this cases, you can use maskitoStrictCompositionPlugin
. It applies mask's constraints on ANY intermediate value of IME composition.
The following sections are recommended to explore core concepts further: