Hello RichK,
depending on your application case you could:
Option 1: handle the limitation outside of the Text Editor component. For this purpose:
- add a slot method to the component containing the Text Editor.
- assign the slot method to the Editor's property OnChange.
- implement the slot method with following code lines (here to limit the number to 5 signs):
if ( TextEditor.String.length > 5 )
TextEditor.String = TextEditor.String.remove( 0, 1 );
Option 2: Modify the Text Editor component to stop appending signs as soon as the desired number signs ahs been entered.
- Open the Text Editor component for editing.
- Look for the slot method named onCharacterKey:
- Open the method for editing and add following two lines at its beginning (here to limit the number of signs to 8):
Generally, the Text Editor component is just a template. You can modify and enhance t according to your application case. You could, for example, enhance it by a new property named MaxLength. Then use this property in the if condition from the screenshot above. In this manner, you can configure each instance of the Text Editor with different parameters to limit the text length.
I hope it helps you further.
Best regards
Paul Banach