soywod / react-pin-field

📟 React component for entering PIN codes.
https://soywod.github.io/react-pin-field/
MIT License
413 stars 24 forks source link

Delete key is not triggering any event #15

Closed sclavijo93 closed 4 years ago

sclavijo93 commented 4 years ago

If I complete the pin field and then I delete one of the fields with the Delete key the onChange event is not fired

Code example:

codesandbox.io

Steps to reproduce:

Environment

Tech Version
Browser Chrome Version 80.0.3987.149 (Official Build) (64-bit)
react 16.13.0
react-pin-field 1.0.1
soywod commented 4 years ago

Try to delete one field with the Delete key

You mean the Delete evt.key (evt.which 46) or the Backspace evt.key (evt.which 8)?

sclavijo93 commented 4 years ago

I mean Delete key (evt.which 46)

soywod commented 4 years ago

Indeed, the Delete key is not handled, I will fix ASAP. Thank you for the feedback!

sclavijo93 commented 4 years ago

Thanks! I was looking at the code and what do you think about adding the "Delete" case here? Lines

soywod commented 4 years ago

Fixed in v1.0.2 [diff] :tada:

sclavijo93 commented 4 years ago

@soywod Great! Thank you so much! I love your component