Closed rajpootathar closed 1 year ago
if you need to unset maxLength
just pass empty value
<CodeField
maxLength={undefined}
/>
Actually i need 6 digits But i need to be able to copy paste whole sms and then only take 6 digits from sms or however many digits are there in maxlength.
On Fri, 16 Jun 2023 at 6:23 PM Davyd NRB @.***> wrote:
if you need to unset maxLength just pass empty value
<CodeField maxLength={undefined}/>
— Reply to this email directly, view it on GitHub https://github.com/retyui/react-native-confirmation-code-field/pull/222#issuecomment-1594670513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ3O3WD2MMXIT7DJ4VNE6TXLRM3VANCNFSM6AAAAAAZJDU2NY . You are receiving this because you authored the thread.Message ID: @.*** com>
teen use a combination of maxLength
& onChangeText
<CodeField
maxLength={undefined}
onChangeText={text => setValue( text.replace(/\D/g, '').slice(0, 6) )}
/>
I did but it does not paste more then maxlength
On Fri, 16 Jun 2023 at 7:58 PM Davyd NRB @.***> wrote:
teen use a combination of maxLength & onChangeText
<CodeField maxLength={undefined} onChangeText={text => setValue( text.replace(/\D/g, '').slice(0, 6) )}/>
— Reply to this email directly, view it on GitHub https://github.com/retyui/react-native-confirmation-code-field/pull/222#issuecomment-1594833112, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ3O3X4EQDRB3H62UJETRLXLRYC5ANCNFSM6AAAAAAZJDU2NY . You are receiving this because you authored the thread.Message ID: @.*** com>
can you try maxLength={99999}
?
Then it will generate 99999 blocks I need 6 blocks and able to copy long text “your otp for x application is 662244”
On Fri, 16 Jun 2023 at 8:04 PM Davyd NRB @.***> wrote:
can you try maxLength={99999} ?
— Reply to this email directly, view it on GitHub https://github.com/retyui/react-native-confirmation-code-field/pull/222#issuecomment-1594840989, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ3O3WY46VR2FFPYD6U6LTXLRYWPANCNFSM6AAAAAAZJDU2NY . You are receiving this because you authored the thread.Message ID: @.*** com>
Prove it!
as I know the cellCount: number
prop is responsible for blocks count
Let me check again
On Fri, 16 Jun 2023 at 8:08 PM Davyd NRB @.***> wrote:
Prove it!
as I know the cellCount: number prop is responsible for blocks count
[image: 111] https://user-images.githubusercontent.com/4661784/246456222-ef82494b-4ede-4ccd-94e4-46d1bd54128c.png
— Reply to this email directly, view it on GitHub https://github.com/retyui/react-native-confirmation-code-field/pull/222#issuecomment-1594846894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ3O3UTH7NG2GLI72LMDIDXLRZHNANCNFSM6AAAAAAZJDU2NY . You are receiving this because you authored the thread.Message ID: @.*** com>
thanks that solved the problem.. the prop should be sent after cellCount
On Fri, Jun 16, 2023 at 8:10 PM Athar Rajpoot @.***> wrote:
Let me check again
On Fri, 16 Jun 2023 at 8:08 PM Davyd NRB @.***> wrote:
Prove it!
as I know the cellCount: number prop is responsible for blocks count
[image: 111] https://user-images.githubusercontent.com/4661784/246456222-ef82494b-4ede-4ccd-94e4-46d1bd54128c.png
— Reply to this email directly, view it on GitHub https://github.com/retyui/react-native-confirmation-code-field/pull/222#issuecomment-1594846894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ3O3UTH7NG2GLI72LMDIDXLRZHNANCNFSM6AAAAAAZJDU2NY . You are receiving this because you authored the thread.Message ID: @.*** com>
reason behind doing it is when copying from SMS, you are can copy full sms and it would not paste.. by doing so you can paste whole length and then when using it you can do something like this