You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I complete the pin field and then I go to the first or any field that is filled and press one of these keys (ArrowUp[38], ArrowDown[40], ContextMenu[93], Esc[27], or whatever key that is not valid with this regex /^[0-9]$/) the content of that field is deleted. Is this intended? Also, the onchange event is not triggered
I think that is better if the pushed key is not valid, that field should stay untouched. Or maybe that could be configurable via a prop? deleteWhenNotValid or whatever, it's just a brainstorming
The field is deleted but the onChange/onComplete event is not triggered.
The current code and completed rows are not updated
Environment
Tech
Version
Browser
Chrome Version 80.0.3987.149 (Official Build) (64-bit)
react
16.13.0
react-pin-field
1.0.2
The text was updated successfully, but these errors were encountered:
sclavijo93
changed the title
onChange/onComplete events not triggered when press a not valid key
onChange/onComplete events not triggered when a not valid key is pressed
Mar 27, 2020
You right, it makes more sense to keep the field untouched when a key is rejected. I don't think a prop is needed, since the behaviour can be simulated inside the onRejectKey. I will fix ASAP. Or feel free to propose a PR :)
If I complete the pin field and then I go to the first or any field that is filled and press one of these keys (ArrowUp[38], ArrowDown[40], ContextMenu[93], Esc[27], or whatever key that is not valid with this regex /^[0-9]$/) the content of that field is deleted. Is this intended? Also, the onchange event is not triggered
I think that is better if the pushed key is not valid, that field should stay untouched. Or maybe that could be configurable via a prop?
deleteWhenNotValid
or whatever, it's just a brainstormingCode example:
codesandbox.io
Steps to reproduce:
current code
andcompleted
rows are not updatedEnvironment
The text was updated successfully, but these errors were encountered: