I want to set the maxChars
property of the TextInput of an editable ComboBox. I am currently trimming the text to a set number of characters using a change Event:
private function nameOptionSelector_changeHandler(event:ListEvent):void
{
nameOptionSelector.text = nameOptionSelector.text.substr(0, MAX_LENGTH);
}
This feels like overkill. There's got to be a better way to do this....
You could extend ComboBox
and override the default maxChars
value for the internal TextInput
. If you need to set it dynamically, you could add a public method to set the property on the extended class.