Query: How can I limit custom input length

Hello,

Is there a property to limit the length of a custom multi select item or will i have to handle it myself in OnChipTag event?

Regards
Vincen

1 Reply 1 reply marked as answer

BC Berly Christopher Syncfusion Team May 10, 2021 03:09 PM UTC

Hi Vincent, 
  
Greetings from Syncfusion support. 
  
We can restrict the number of characters allowed on the input element when typing with help of maxLength property through HtmlAttributes API as mentioned in the below code example. 
  
<SfMultiSelect TValue="string[]" TItem="Countries" HtmlAttributes="@(new Dictionary<string,object>() { { "maxLength", "3" } })" Placeholder="e.g. Australia" DataSource="@Country" AllowCustomValue="true"> 
    <MultiSelectFieldSettings Text="Name" Value="Code"></MultiSelectFieldSettings> 
</SfMultiSelect> 
  
  
Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon