Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add max length in input of semantic-ui-react?

Max length is not working in Input of semantic-ui-react.

<Input {...input} type={type} size={inputSize} transparent={transparent} disabled={disabled}>
   <input data-selector={`${dataSelector}-input`} maxlength="2" />
</Input>
like image 604
Balram Singh Avatar asked Oct 19 '17 10:10

Balram Singh


People also ask

How do you increase the size of the input box in react?

You can render the TextBox in two different sizes. By default, the TextBox is rendered with normal size. You need to add e-small class to the input element, or else add to the input container.

How do I limit text field length in react?

Approach 1: Using maxLength: We will use maxLength attribute for our input. It is the same as the maxlength attribute used for HTML. It restricts the user to enter characters till it reaches the maxLength limit that we have set.

Which is better semantic UI or material UI?

According to the StackShare community, Material-UI has a broader approval, being mentioned in 69 company stacks & 80 developers stacks; compared to Semantic UI React, which is listed in 16 company stacks and 22 developer stacks.


1 Answers

You are missing the capital

e.g. maxLength="2"

like image 80
Lucas SenCab A Ugh Avatar answered Sep 18 '22 16:09

Lucas SenCab A Ugh