react-otp-input icon indicating copy to clipboard operation
react-otp-input copied to clipboard

Allow clear value from specific textbox

Open Ajaykumbhare opened this issue 3 years ago • 4 comments

Issue

When I am trying to remove value from nth textbox then I need to reEnter value in each textbox. For example, I am trying to add my OTP input as 1-2-3-4 but when I am trying to clear the value from 2nd textbox then textbox value becomes 1-3-4-(empty).

Solution

It will be good if we allow removing specific textbox values like 1-2-3-4 and if users want to clear value from 2nd textbox and want to write the value as 5 then users no need to rewrite value in all textbox. so whenever user clear value from 2nd textbox then the user can easily write 5 value in 2nd textbox instead clear all value and rewrite again.

If it does make sense then you can assign me this task so I can work on it.

Ajaykumbhare avatar Oct 01 '20 06:10 Ajaykumbhare

@Ajaykumbhare This does sound like an improvement over the current behaviour. #100 hints at fixing the same value/focus shift so I believe we should definitely try to improve it!

apollonian avatar Oct 01 '20 17:10 apollonian

I can do this, please assign the same to me

neeleshbisht99 avatar Oct 02 '20 11:10 neeleshbisht99

@apollonian #171 I have raised PR please review it and let me know if you need anything from my side

Ajaykumbhare avatar Oct 02 '20 15:10 Ajaykumbhare

Do we have the fix?

PRANAVBHATIA1999 avatar Nov 10 '21 10:11 PRANAVBHATIA1999