I have 100000 phoneNumbers to input in MUI TextField multiline, when there upto 10000 phone number working fine, but when there is more than that it cause line break issue
<Controller
name="contacts"
control={control}
rules={{
required:
file !== null || selectedGroups?.length > 0
? false
: 'Number Required',
pattern: {
value: /^([0-9]{10})(,[0-9]{10})*$/,
// value: /^((+(91)[0-9s]{10}(,+(91)d{10})?*)*)+$/,
// value: /^(([0-9s]{10}(,d{10})?)*)+$/,
message: 'Please enter valid format.',
},
}}
render={({ field }) => (
<TextFiled
inputRef={toRef}
fullWidth
InputProps={{
onFocus: () => {
setFocus('to');
},
readOnly: csvData ? true : false,
}}
type="number"
multiline
minRows={6}
maxRows={10}
maxLength={1500000}
placeholder="Enter mobile number here 1234567890,1234567890,1234567890,1234567890,1234567890,1234567890"
{...field}
onChange={(e) => {
const result = e.target.value.replace(
/[^0-9+,]/gi,
''
);
e.target.value = result;
field.onChange(e);
}}
error={errors.contacts?.message}
/>
)}
/>
It should accepts atleast 100000 phone numbers