View Map Scope
Information passed into the viewMap
callback in the input method.
The user can check the current character being transformed (via the ch property), but the entire input so far and the character's index into it are also provided in case the context helps with the mapping. It's expected that none of these values will be needed in many cases, e.g. masking a password, but you can refer to them if you need to!
For an example, to visually render all input text as uppercase (while the underlying input will be whatever case the user typed in), you could call:
input(viewMap = { ch.uppercaseChar() })
Content copied to clipboard
or for masking a password, simply:
input(viewMap = { '*' })
Content copied to clipboard