Introduction to modern Text Input control
Text Input control has been around in Power Apps ever since Power Apps came into existence. So although it isn't a new control, the modern version has some minor differences (read: additions and some subtractions) when compared to the classic text input control. This will probably be one of the shorter modern control blog post as the differences between the classic and modern text input are very minimal.
New Properties
- Type - The type of text that is entered. There are 3 options:
-
'TextInputCanvas.Type'.Text (default)
-
'TextInputCanvas.Type'.Password
-
'TextInputCanvas.Type'.Search
-
- TriggerOutput - When the OnChange should be triggered. There are 3 options:
-
'TextInputCanvas.TriggerOutput'.FocusOut (default) - To trigger OnChange when the user pauses typing
-
'TextInputCanvas.TriggerOutput'.Delayed - To trigger OnChange when the user selects a different control or clicks outside the control
-
'TextInputCanvas.TriggerOutput'.Keypress - To trigger OnChange immediately on every character input
-
- Appearance - There are 3 different options:
- 'TextInputCanvas.Appearance'.FilledDarker (default)
- 'TextInputCanvas.Appearance'.FilledLighter
- 'TextInputCanvas.Appearance'.Outline
- ValidationState - When the error state is selected the control’s border is highlighted in red. There are 2 options:
- 'TextInputCanvas.ValidationState'.None (default)
-
'TextInputCanvas.ValidationState'.Error
Renamed Properties
- TriggerOutput - When the OnChange should be triggered. This used to be called DelayOutput (a boolean value). The new TriggerOutput property has 3 options:
-
'TextInputCanvas.TriggerOutput'.FocusOut (default) - To trigger OnChange when the user pauses typing
-
'TextInputCanvas.TriggerOutput'.Delayed - To trigger OnChange when the user selects a different control or clicks outside the control
-
'TextInputCanvas.TriggerOutput'.Keypress - To trigger OnChange immediately on every character input
-
- Value - This used to called Default. It indicates the default value of the text input control
- Placeholder - This used to be called HintText. It is the text shown when there is no text in the control
Removed Properties
- VirtualKeyboardMode - I really miss this property. This property had 3 different options:
-
VirtualKeyboardMode.Auto (default)
-
VirtualKeyboardMode.Numeric - this opens a numeric keypad on the user's device
-
VirtualKeyboardMode.Text
-
Some of the properties to style this control are gone like HoverColor, HoverFill. This might seem a bit crippling to some makers, but trust me, losing some of these properties has been a blessing for me. Lack of these properties helps ensure that the controls look neat and clean.
Using modern Text Input control
The one property that some of the modern controls have lost in comparison to their classic versions is the Reset property. I do miss it at times. I used that property to reset controls to their default values using a variable. Now that the Reset property isn't there anymore, you can still reset controls by using the Reset function. To learn more about the Reset function, click here.
Stay tuned for the remaining modern controls!
To read the official documentation of modern controls, click here.