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>
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.
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.
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.
You are missing the capital
e.g. maxLength="2"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With