Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed backspace behaviour to remove the last input when focus is on an empty input #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JopMaarse
Copy link

When you are focused on an empty input and press backspace, the focus changes to one index lower, but that input value is not removed. Then when you type a new value, nothing happens.
This change makes it so that when you press backspace on an empty input field, the last value is removed.

Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ngx-otp-input ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 3:58pm

@pkovzz
Copy link
Owner

pkovzz commented Mar 18, 2025

Hi @JopMaarse,

Thank you for opening your pull request!

Previously, there was a request not to automatically delete the input value. The library included a setting to control this behavior before version 1.0.0, but I did not reintroduce that option during the refactor. I think we could consider adding this option back and keep both behaviors. What are your thoughts?

@JopMaarse
Copy link
Author

An option to choose the behaviour seems perfectly fine to me. Do you need me to change the pull request, or will you take it from here? If you want me to change it, can you link to the commit that removed the option?

@pkovzz
Copy link
Owner

pkovzz commented Mar 18, 2025

I can take it from here, thank your very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants