TextInputProperties
export type TextInputProperties = {
Enabled: CanBeState<boolean>?,
Text: CanBeValue<string>?,
TextXAlignment: CanBeValue<Enum.TextXAlignment>?,
CornerRadius: CanBeState<UDim>?,
PaddingLeft: CanBeState<UDim>?,
PaddingRight: CanBeState<UDim>?,
OnChange: (newText: string) -> nil,
OnFocusLost: (newText: string) -> nil,
Filter: (newText: string) -> boolean,
[any]: any,
}
The TextInputProperties table that is given to the TextInput() function that contains data about the desired TextInput.
Properties
Enabled : CanBeState<boolean>?
Sets whether the TextInput will be enabled or not. Can either be a State containing a boolean, or a boolean.
Text : CanBeValue<string>?,
The default text that will be displayed on the TextInput. Can either be a Value containing a string, or a string.
This property can be changed by the end-user.
TextXAlignment : CanBeValue<Enum.TextXAlignment>?,
The default text alignment of the TextInput. Can either be a Value containing an Enum, or an Enum.
CornerRadius : CanBeState<UDim>?
Sets the corner radius of the TextInput. Can either be a State containing an UDim, or an UDim.
PaddingLeft : CanBeState<UDim>?,
How much padding will be applied to the descendants of the TextInput on the left side. Can either be a State containing an UDim, or an UDim.
PaddingRight : CanBeState<UDim>?,
How much padding will be applied to the descendants of the TextInput on the right side. Can either be a State containing an UDim, or an UDim.
OnChange : (newText: string) -> nil,
The callback function that will be called when the Text property changes.
OnFocusLost : ((newText: string) -> nil)?,
The callback function that will be called when the focus has been lost on the TextInput, when Enter has been pressed.
If the Filter callback function has been set, then this function will only be called after Filter callback function returns true.
Filter : ((newText: string) -> boolean)?,
The callback function that will be called when the focus has been lost on the TextInput, when Enter has been pressed.
This function is called first if defined, and allows you to filter the incoming text on the TextInput.
If this function returns true, then the text will be deemed filtered, and the OnFocusLost callback function will be called, if it exists. And the Text property of the TextInput will be set to the newText.
If this function returns false, then the Text property will automatically be reverted to its previous state.